/* AlphaMind Design System - Centralized Theme Variables */
/* Version: 1.0.0 | Last Updated: December 6, 2025 */

:root {
    /* === PRIMARY BRAND COLORS === */
    --color-midnight-blue: #0A1F44;
    --color-white: #FFFFFF;
    --color-sky-blue: #4DA3FF;
    --color-sky-blue-hover: #3B8FE8;
    --color-sky-blue-dark: #357ABD;
    --color-graph-green: #28C76F;
    --color-graph-green-dark: #22A55E;
    
    /* === NEUTRAL COLORS === */
    --color-bg-page: #F4F4F4;
    --color-bg-card: #FFFFFF;
    --color-bg-hover: #F8F9FA;
    --color-bg-secondary: #F4F4F4;
    
    /* === TEXT COLORS === */
    --color-text-primary: #333333;
    --color-text-secondary: #666666;
    --color-text-tertiary: #999999;
    --color-text-white: #FFFFFF;
    --color-text-heading: #0A1F44;
    
    /* === BORDER COLORS === */
    --color-border-default: #E8E8E8;
    --color-border-focus: #4DA3FF;
    --color-border-hover: #4DA3FF;
    
    /* === STATUS COLORS === */
    --color-success: #28C76F;
    --color-success-bg: #E8F8F0;
    --color-error: #EA5455;
    --color-error-bg: #FFF3F3;
    --color-warning: #FF9F43;
    --color-warning-bg: #FFF8F0;
    --color-info: #4DA3FF;
    --color-info-bg: #F0F7FF;
    
    /* === BUTTON COLORS === */
    --color-btn-primary: #4DA3FF;
    --color-btn-primary-hover: #3B8FE8;
    --color-btn-secondary: #666666;
    --color-btn-secondary-hover: #555555;
    --color-btn-danger: #EA5455;
    --color-btn-danger-hover: #D64344;
    
    /* === SHADOWS === */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 10px 40px rgba(0, 0, 0, 0.2);
    --shadow-focus: 0 0 0 3px rgba(77, 163, 255, 0.1);
    --shadow-button-hover: 0 4px 12px rgba(77, 163, 255, 0.3);
    
    /* === TYPOGRAPHY === */
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.85rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.1rem;
    --font-size-xl: 1.3rem;
    --font-size-2xl: 1.75rem;
    --font-size-3xl: 2.25rem;
    
    /* === SPACING === */
    --spacing-xs: 5px;
    --spacing-sm: 10px;
    --spacing-md: 15px;
    --spacing-lg: 20px;
    --spacing-xl: 30px;
    --spacing-2xl: 40px;
    
    /* === BORDER RADIUS === */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 50%;
    
    /* === TRANSITIONS === */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;
}

/* === GLOBAL BASE STYLES === */
body {
    font-family: var(--font-body);
    background: var(--color-bg-page);
    color: var(--color-text-primary);
    font-size: 16px;
    line-height: 1.6;
}

/* === HEADINGS === */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-text-heading);
    font-weight: 700;
}

h1 { font-size: 36px; }
h2 { font-size: 28px; }
h3 { font-size: 22px; }
h4 { font-size: 18px; }

/* === CARD COMPONENT === */
.card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-md);
}

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

/* === BUTTON COMPONENT === */
.btn {
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    font-size: var(--font-size-base);
}

.btn-primary {
    background: var(--color-btn-primary);
    color: var(--color-text-white);
}

.btn-primary:hover {
    background: var(--color-btn-primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-button-hover);
}

.btn-secondary {
    background: var(--color-btn-secondary);
    color: var(--color-text-white);
}

.btn-secondary:hover {
    background: var(--color-btn-secondary-hover);
}

.btn-danger {
    background: var(--color-btn-danger);
    color: var(--color-text-white);
}

.btn-danger:hover {
    background: var(--color-btn-danger-hover);
}

/* === FORM INPUTS === */
input, select, textarea {
    background: var(--color-bg-card);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border-default);
    padding: 12px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    transition: all var(--transition-base);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--color-border-focus);
    box-shadow: var(--shadow-focus);
}

label {
    color: var(--color-text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

/* === STATUS MESSAGES === */
.alert-success {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid var(--color-success);
    padding: 15px;
    border-radius: var(--radius-md);
}

.alert-error {
    background: var(--color-error-bg);
    color: var(--color-error);
    border: 1px solid var(--color-error);
    padding: 15px;
    border-radius: var(--radius-md);
}

.alert-warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
    border: 1px solid var(--color-warning);
    padding: 15px;
    border-radius: var(--radius-md);
}

.alert-info {
    background: var(--color-info-bg);
    color: var(--color-info);
    border: 1px solid var(--color-info);
    padding: 15px;
    border-radius: var(--radius-md);
}

/* === TEXT UTILITIES === */
.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-tertiary { color: var(--color-text-tertiary); }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-error); }
.text-warning { color: var(--color-warning); }
.text-info { color: var(--color-sky-blue); }

/* === BACKGROUND UTILITIES === */
.bg-card { background: var(--color-bg-card); }
.bg-secondary { background: var(--color-bg-secondary); }
.bg-hover { background: var(--color-bg-hover); }

/* === SPINNER/LOADER === */
.spinner {
    border: 3px solid var(--color-border-default);
    border-top: 3px solid var(--color-sky-blue);
    border-radius: var(--radius-full);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === TABLE STYLES === */
table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background: var(--color-midnight-blue);
    color: var(--color-text-white);
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

table td {
    padding: 12px;
    border-bottom: 1px solid var(--color-border-default);
    color: var(--color-text-primary);
}

table tr:hover {
    background: var(--color-bg-hover);
}

/* === BADGE COMPONENT === */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: var(--font-size-xs);
    font-weight: 600;
}

.badge-primary {
    background: var(--color-sky-blue);
    color: var(--color-text-white);
}

.badge-success {
    background: var(--color-success);
    color: var(--color-text-white);
}

.badge-error {
    background: var(--color-error);
    color: var(--color-text-white);
}

.badge-warning {
    background: var(--color-warning);
    color: var(--color-text-white);
}

/* === HEADER STYLES === */
.header {
    background: var(--color-bg-card);
    padding: 20px 40px;
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--color-midnight-blue);
}

.nav a {
    color: var(--color-midnight-blue);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    font-size: 15px;
    font-weight: 600;
}

.nav a:hover {
    background: var(--color-bg-secondary);
    color: var(--color-sky-blue);
}

.nav a.active {
    background: var(--color-sky-blue);
    color: var(--color-text-white);
    box-shadow: var(--shadow-button-hover);
}

/* === FOOTER STYLES === */
.footer {
    background: var(--color-midnight-blue);
    text-align: center;
    color: var(--color-text-white);
    padding: 30px 20px;
    margin-top: 50px;
    font-size: var(--font-size-sm);
}

/* === MODAL STYLES === */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 31, 68, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-lg);
    padding: 30px;
    max-width: 600px;
    width: 90%;
    box-shadow: var(--shadow-xl);
}

/* === UTILITY CLASSES === */
.hidden { display: none !important; }
.flex { display: flex; }
.grid { display: grid; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

/* === TEXT OVERFLOW HANDLING === */
.text-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-break {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* === RESPONSIVE GRID UTILITIES === */
.grid-responsive {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* === RESPONSIVE BREAKPOINTS === */
@media (max-width: 1400px) {
    .container {
        max-width: 100%;
        padding: 25px 30px;
    }
}

@media (max-width: 1024px) {
    /* Tablets */
    :root {
        --font-size-3xl: 2rem;
        --font-size-2xl: 1.5rem;
        --font-size-xl: 1.2rem;
    }
    
    .container {
        padding: 20px 25px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }
    
    .nav-bar {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

@media (max-width: 768px) {
    /* Mobile landscape and smaller tablets */
    :root {
        --font-size-3xl: 1.75rem;
        --font-size-2xl: 1.35rem;
        --font-size-xl: 1.1rem;
        --spacing-xl: 20px;
        --spacing-2xl: 30px;
    }
    
    .container {
        padding: 15px 20px;
    }
    
    .card {
        padding: 20px;
        margin-bottom: 15px;
    }
    
    .modal-content {
        padding: 20px;
        width: 95%;
    }
    
    /* Make tables horizontally scrollable */
    .comparison-table,
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Stack form grids vertically */
    .form-grid,
    .grid-responsive {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 640px) {
    /* Mobile portrait */
    :root {
        --font-size-3xl: 1.5rem;
        --font-size-2xl: 1.25rem;
        --font-size-xl: 1rem;
        --font-size-base: 0.95rem;
    }
    
    body {
        font-size: 14px;
    }
    
    .container {
        padding: 12px 15px;
    }
    
    .header {
        padding: 12px 15px;
    }
    
    .logo-text {
        font-size: 20px;
    }
    
    .nav-bar a {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .card {
        padding: 15px;
        border-radius: 8px;
    }
    
    h1 {
        font-size: 28px;
    }
    
    h2 {
        font-size: 22px;
    }
    
    h3 {
        font-size: 18px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .tab {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    /* Hide less critical columns in tables */
    .hide-mobile {
        display: none !important;
    }
    
    /* Make badges wrap */
    .badge-container {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    /* Small mobile devices */
    .container {
        padding: 10px 12px;
    }
    
    .card {
        padding: 12px;
    }
    
    .modal-content {
        padding: 15px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .logo-container img {
        height: 80px;
    }
}
