/* Main Styles - Colors, Typography, and Theme */

:root {
    /* Color Palette */
    --primary-color: #1e3a8a;
    --primary-light: #3b82f6;
    --primary-dark: #1e40af;
    --secondary-color: #059669;
    --secondary-light: #10b981;
    --accent-color: #e0e7ff;

    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f7fa;
    --bg-accent: #e0e7ff;

    /* Text Colors */
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;

    /* Status Colors */
    --success-color: #059669;
    --warning-color: #f59e0b;
    --error-color: #dc2626;
    --info-color: #3b82f6;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;
}

/* Input Styles */
input[type="text"],
input[type="number"],
input[type="date"],
select {
    font-family: inherit;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

input[type="number"] {
    text-align: right;
}

/* Quantity Input Styling */
.quantity-input {
    background-color: white;
    transition: all var(--transition-base);
}

.quantity-input:hover {
    border-color: var(--gray-400);
}

.quantity-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

/* Button Hover Effects */
.btn {
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: translateY(1px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Toggle Button Animation */
.toggle-btn {
    transition: transform var(--transition-base);
}

.category-section.collapsed .toggle-btn {
    transform: rotate(180deg);
}

/* Category Header Hover Effect */
.category-header:hover {
    background-color: #c7d2fe;
}

/* Line Item Hover Effect */
.line-item {
    transition: background-color var(--transition-base);
}

.line-item:hover {
    background-color: var(--gray-50);
}

/* Line Total Highlighting */
.line-total {
    font-size: 1rem;
    transition: color var(--transition-base);
}

.line-item:hover .line-total {
    color: var(--secondary-light);
}

/* Summary Panel Animation */
.summary-panel {
    transition: box-shadow var(--transition-base);
}

.summary-panel:hover {
    box-shadow: var(--shadow-lg);
}

/* Grand Total Pulse Effect */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.grand-total.updated {
    animation: pulse 0.5s ease-in-out;
}

/* Currency Formatting */
.currency {
    font-variant-numeric: tabular-nums;
}

/* Tooltip Styles (for future use) */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--gray-900);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Error State */
.error {
    border-color: var(--error-color) !important;
}

.error-message {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Success State */
.success {
    border-color: var(--success-color) !important;
}

/* Focus Visible for Accessibility */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Category Color Coding (Optional) */
#base-implementation .category-header {
    background-color: #dbeafe;
    border-bottom-color: #1e3a8a;
}

#email-data .category-header {
    background-color: #fef3c7;
    border-bottom-color: #f59e0b;
}

#servers .category-header {
    background-color: #d1fae5;
    border-bottom-color: #059669;
}

#security .category-header {
    background-color: #fecaca;
    border-bottom-color: #dc2626;
}

#networking .category-header {
    background-color: #e9d5ff;
    border-bottom-color: #9333ea;
}

#rmm .category-header {
    background-color: #bfdbfe;
    border-bottom-color: #3b82f6;
}

/* Selection Styling */
::selection {
    background-color: var(--primary-light);
    color: white;
}

/* Scrollbar Styling (Webkit browsers) */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}
