:root {
    /* Color Palette - Professional Education Theme */
    --primary-hue: 217;
    --primary-sat: 91%;
    --primary-light: 60%;

    --primary-color: hsl(var(--primary-hue), var(--primary-sat), var(--primary-light));
    --primary-dark: hsl(var(--primary-hue), var(--primary-sat), 50%);
    --primary-light-bg: hsl(var(--primary-hue), var(--primary-sat), 96%);

    --secondary-color: hsl(280, 70%, 60%);
    --accent-color: hsl(340, 85%, 60%);
    --success-color: hsl(142, 71%, 45%);
    --warning-color: hsl(38, 92%, 50%);
    --error-color: hsl(0, 84%, 60%);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, hsl(217, 91%, 60%) 0%, hsl(260, 75%, 60%) 100%);
    --gradient-secondary: linear-gradient(135deg, hsl(180, 70%, 50%) 0%, hsl(217, 91%, 60%) 100%);
    --gradient-accent: linear-gradient(135deg, hsl(340, 85%, 60%) 0%, hsl(280, 70%, 60%) 100%);

    /* Neutral Colors - Improved Contrast */
    --bg-color: hsl(220, 20%, 98%);
    --surface-color: #ffffff;
    --text-primary: hsl(220, 20%, 10%);
    /* Darker for 4.5:1 contrast */
    --text-secondary: hsl(220, 15%, 35%);
    /* Darker than before */
    --text-muted: hsl(220, 10%, 55%);
    /* Still readable */
    --border-color: hsl(220, 15%, 85%);
    /* More visible */

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== LOGIN PAGE ==================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
}

.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1000px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-image {
    position: relative;
    overflow: hidden;
    min-height: 500px;
}

.login-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.login-form-container {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: white;
}

.login-card {
    background: transparent;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    animation: none;
    border: none;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.logo-circle {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-md);
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-lg);
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    line-height: 1.3;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.teacher-info {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.login-form {
    margin-bottom: var(--spacing-md);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: var(--font-family);
    transition: all 0.3s ease;
    background: var(--surface-color);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-light-bg);
}

.form-group small {
    display: block;
    margin-top: var(--spacing-xs);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.error-message {
    background: hsl(0, 75%, 95%);
    color: var(--error-color);
    padding: var(--spacing-sm);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-md);
    font-size: 0.9rem;
    border-left: 4px solid var(--error-color);
}

.btn-primary {
    width: 100%;
    padding: 1rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.login-footer {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ==================== DASHBOARD ==================== */
.dashboard {
    min-height: 100vh;
    background: var(--bg-color);
}

.dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-icon {
    font-size: 2.5rem;
}

.header-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.header-subtitle {
    font-size: 0.875rem;
    opacity: 0.95;
    margin: 0.25rem 0 0 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.notification-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.notification-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info span {
    font-size: 0.9rem;
}

.btn-logout {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
}

.user-bar {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.welcome-text {
    font-weight: 600;
    color: var(--text-primary);
}

.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.module-card {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid var(--border-color);
    border-top: 4px solid #ccc;
    position: relative;
    text-align: center;
}

/* Colored top borders for each module */
.module-home {
    border-top-color: #FF6B6B;
}

.module-overview {
    border-top-color: #4ECDC4;
}

.module-docs {
    border-top-color: #FFD93D;
}

.module-qa {
    border-top-color: #95E1D3;
}

.module-counseling {
    border-top-color: #A8E6CF;
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.module-icon-emoji {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
    display: inline-block;
    transition: transform 0.25s ease;
}

.module-card:hover .module-icon-emoji {
    transform: scale(1.1);
}

.module-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin: 0 auto var(--spacing-md);
    transition: transform 0.25s ease;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

.module-card:hover .module-icon {
    transform: scale(1.08) rotate(2deg);
}

.module-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0;
}

.module-card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
    margin-top: 0.5rem;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .login-container {
        grid-template-columns: 1fr;
        max-width: 500px;
    }

    .login-image {
        display: none;
    }

    .login-form-container {
        padding: 2rem;
    }

    .login-card {
        padding: var(--spacing-lg);
    }

    .login-header h1 {
        font-size: 1.25rem;
    }

    .dashboard-header {
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .header-left {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-text h1 {
        font-size: 1.1rem;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .user-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .modules-grid {
        grid-template-columns: 1fr;
    }

    .user-bar {
        flex-direction: column;
        gap: var(--spacing-sm);
        text-align: center;
    }

    .main-content {
        padding: 1rem;
    }
}

/* ==================== ACCESSIBILITY ==================== */
*:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Remove outline for mouse users */
*:focus:not(:focus-visible) {
    outline: none;
}

/* Ensure keyboard navigation is visible */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* ==================== UTILITY CLASSES ==================== */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: var(--spacing-sm);
}

.mt-2 {
    margin-top: var(--spacing-md);
}

.mt-3 {
    margin-top: var(--spacing-lg);
}

.mb-1 {
    margin-bottom: var(--spacing-sm);
}

.mb-2 {
    margin-bottom: var(--spacing-md);
}

.mb-3 {
    margin-bottom: var(--spacing-lg);
}

.cursor-pointer {
    cursor: pointer;
}

.transition-smooth {
    transition: all 0.2s ease-in-out;
}

.transition-colors {
    transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}