/* ==========================================================================
   Base Styles & Variables (Premium Colors and Fonts)
   ========================================================================== */
:root {
    --primary-color: #2563eb; /* Royal Blue */
    --primary-hover: #1d4ed8;
    --secondary-color: #f59e0b; /* Amber/Orange */
    --text-dark: #1e293b; /* Slate 800 */
    --text-light: #64748b; /* Slate 500 */
    --bg-light: #f8fafc; /* Slate 50 */
    --white: #ffffff;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ==========================================================================
   Navigation Bar (Top Menu)
   ========================================================================== */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 5%;
    background-color: var(--white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo span { color: var(--secondary-color); }

.nav-links { display: flex; gap: 2rem; }
.nav-links a { font-weight: 600; color: var(--text-light); transition: color 0.3s ease; }
.nav-links a:hover { color: var(--primary-color); }

.nav-buttons { display: flex; gap: 1rem; }

.btn-outline {
    padding: 0.5rem 1.2rem;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}
.btn-outline:hover { background-color: var(--primary-color); color: var(--white); }

.btn-primary {
    padding: 0.6rem 1.5rem;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
}
.btn-primary:hover { background-color: var(--primary-hover); }

/* ==========================================================================
   Hero Section (Main Banner - Home Page)
   ========================================================================== */
.hero-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5rem 5%;
    background: linear-gradient(135deg, #f0fdf4 0%, #dbeafe 100%);
    min-height: 80vh;
}

.hero-content { flex: 1; max-width: 600px; }

.badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background-color: #fee2e2;
    color: #ef4444;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.hero-content h1 { font-size: 3.5rem; line-height: 1.2; margin-bottom: 1.5rem; color: var(--text-dark); }
.highlight { color: var(--primary-color); position: relative; display: inline-block; }
.highlight::after {
    content: ''; position: absolute; width: 100%; height: 8px;
    background-color: var(--secondary-color); bottom: 5px; left: 0;
    z-index: -1; opacity: 0.5; border-radius: 4px;
}

.hero-content p { font-size: 1.2rem; color: var(--text-light); margin-bottom: 2.5rem; }
.hero-actions { display: flex; flex-direction: column; gap: 1.5rem; }

.btn-primary-large {
    display: inline-block; padding: 1rem 2rem;
    background-color: var(--primary-color); color: var(--white);
    border-radius: 12px; font-size: 1.2rem; font-weight: bold;
    text-align: center; width: fit-content; box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary-large:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.btn-primary-large i { margin-left: 10px; }

.stats { display: flex; gap: 2rem; font-weight: 600; color: var(--text-dark); }
.stats span i { color: var(--secondary-color); margin-right: 5px; }

.hero-image { flex: 1; display: flex; justify-content: flex-end; }
.hero-image img { max-width: 100%; height: auto; animation: float 4s ease-in-out infinite; }

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

/* ==========================================================================
   Login Page Specific Styles (Login Page Design)
   ========================================================================== */
.login-bg { 
    height: 100vh; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%); 
}

.login-card { 
    background: white; 
    padding: 40px; 
    border-radius: 20px; 
    box-shadow: var(--shadow-lg); 
    width: 100%; 
    max-width: 400px; 
    text-align: center; 
    margin: auto; 
}

.login-logo { font-size: 1.8rem; font-weight: 800; color: var(--primary-color); margin-bottom: 10px; }
.login-logo span { color: var(--secondary-color); }
.login-card h2 { font-size: 1.4rem; color: var(--text-dark); margin-bottom: 5px; }
.login-card p { color: var(--text-light); font-size: 0.9rem; margin-bottom: 25px; }

.input-group { position: relative; margin-bottom: 20px; text-align: left; }
.input-group i { position: absolute; left: 15px; top: 17px; color: #94a3b8; }
.input-group input { 
    width: 100%; padding: 15px 15px 15px 45px; 
    border: 2px solid var(--border-color); border-radius: 10px; 
    font-size: 1rem; outline: none; transition: all 0.3s;
}
.input-group input:focus { 
    border-color: var(--primary-color); 
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.login-footer { margin-top: 25px; font-size: 0.9rem; }
.login-footer a { color: var(--primary-color); font-weight: 600; }
.back-home { 
    display: block; margin-top: 15px; text-decoration: none; 
    color: var(--text-light) !important; transition: color 0.3s;
}
.back-home:hover { color: var(--primary-color) !important; }

/* ==========================================================================
   UI Components & Utilities (Loaders, Spinners)
   ========================================================================== */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    width: 100%;
}

.custom-spinner {
    width: 45px;
    height: 45px;
    border: 4px solid var(--border-color); 
    border-top: 4px solid var(--primary-color); 
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-text {
    color: var(--text-light);
    font-size: 0.95rem;
    font-weight: 500;
}

/* ==========================================================================
   Student Dashboard Specific Styles
   ========================================================================== */
.dashboard-body { background-color: #f1f5f9; overflow-x: hidden; }
.dashboard-layout { display: flex; min-height: 100vh; }

/* Sidebar Navigation */
.sidebar {
    width: 260px;
    background: var(--white);
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-logo {
    padding: 20px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-logo span { color: var(--secondary-color); }

.sidebar-menu { list-style: none; padding: 20px 0; flex: 1; }
.sidebar-menu li a {
    display: flex; align-items: center; gap: 15px;
    padding: 15px 25px; color: var(--text-light);
    font-weight: 600; transition: all 0.3s;
}
.sidebar-menu li a:hover, .sidebar-menu li.active a {
    background: #eff6ff; color: var(--primary-color);
    border-right: 4px solid var(--primary-color);
}
.sidebar-menu i { width: 20px; font-size: 1.1rem; }

.logout-box { padding: 20px; border-top: 1px solid var(--border-color); }
.logout-btn {
    display: flex; align-items: center; gap: 10px;
    color: #ef4444; font-weight: bold; padding: 10px;
    border-radius: 8px; transition: 0.3s;
}
.logout-btn:hover { background: #fee2e2; }

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 260px; /* Same as sidebar width */
    padding: 30px 40px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Top Bar */
.top-bar { display: flex; justify-content: space-between; align-items: center; }
.welcome-text h2 { color: var(--text-dark); margin-bottom: 5px; }
.welcome-text p { color: var(--text-light); font-size: 0.95rem; }
.user-profile { display: flex; align-items: center; gap: 20px; }
.notification { position: relative; font-size: 1.2rem; color: var(--text-light); cursor: pointer; }
.notification .dot {
    position: absolute; top: 0; right: 0;
    width: 10px; height: 10px; background: #ef4444;
    border-radius: 50%; border: 2px solid var(--bg-light);
}
.avatar { width: 45px; height: 45px; border-radius: 50%; border: 2px solid var(--primary-color); }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.stat-card {
    background: var(--white); padding: 25px; border-radius: 15px;
    display: flex; align-items: center; gap: 20px;
    box-shadow: var(--shadow-sm); transition: transform 0.3s;
}
.stat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.stat-icon {
    width: 60px; height: 60px; border-radius: 12px;
    display: flex; justify-content: center; align-items: center;
    font-size: 1.5rem;
}
.stat-info h3 { font-size: 1.8rem; color: var(--text-dark); line-height: 1; margin-bottom: 5px; }
.stat-info p { color: var(--text-light); font-size: 0.9rem; font-weight: 600; }

/* Exam List Section */
.exam-section { background: var(--white); padding: 30px; border-radius: 15px; box-shadow: var(--shadow-sm); }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px solid var(--border-color); padding-bottom: 15px; }
.section-header h3 { color: var(--text-dark); }
.view-all { color: var(--primary-color); font-weight: 600; font-size: 0.9rem; }

.exam-list { display: flex; flex-direction: column; gap: 15px; }
.exam-card {
    display: flex; align-items: center; padding: 20px;
    border: 1px solid var(--border-color); border-radius: 12px;
    transition: 0.3s;
}
.exam-card:hover { border-color: var(--primary-color); background: #f8fafc; }
.exam-icon {
    width: 70px; height: 70px; border-radius: 12px;
    display: flex; justify-content: center; align-items: center;
    font-weight: 800; font-size: 1.2rem; color: white; margin-right: 20px;
}
.opsc-bg { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.ossc-bg { background: linear-gradient(135deg, #f59e0b, #d97706); }

.exam-details { flex: 1; }
.exam-details h4 { color: var(--text-dark); margin-bottom: 5px; font-size: 1.1rem; }
.exam-details p { color: var(--text-light); font-size: 0.85rem; }
.btn-start-exam {
    background: #e0e7ff; color: var(--primary-color); padding: 10px 20px;
    border-radius: 8px; font-weight: 600; transition: 0.3s;
}
.btn-start-exam:hover { background: var(--primary-color); color: white; }

/* =========================================================
   📱 MOBILE RESPONSIVE DESIGN (Fixing Overlaps & Tabs)
========================================================= */
@media screen and (max-width: 768px) {
    /* Navbar & Hero Fixes */
    .navbar { flex-direction: column; gap: 1rem; padding: 1rem; }
    .nav-links { display: none; }
    .hero-section { flex-direction: column; text-align: center; padding: 3rem 5%; margin-top: 1rem; }
    .hero-content h1 { font-size: 2.5rem; }
    .hero-actions { align-items: center; }
    .hero-image { margin-top: 3rem; justify-content: center; }
    .stats { flex-direction: column; gap: 1rem; }

    /* Dashboard Layout Fixes */
    .dashboard-layout {
        display: flex;
        flex-direction: column;
    }
    
    /* Convert Sidebar to Bottom Navigation */
    .sidebar {
        width: 100% !important;
        height: 65px !important;
        position: fixed;
        bottom: 0;
        left: 0;
        z-index: 1000;
        display: flex;
        flex-direction: row;
        padding: 0;
        background: white;
        box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
        border-right: none;
        border-top: 1px solid #e2e8f0;
    }
    
    .sidebar-logo, .logout-box {
        display: none !important;
    }
    
    .sidebar-menu {
        display: flex;
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        align-items: center;
        margin: 0;
        padding: 0;
    }
    
    .sidebar-menu li { margin: 0; list-style: none; flex: 1; }
    
    .sidebar-menu li a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 8px 5px;
        font-size: 0.7rem;
        border-radius: 0;
        color: #64748b;
        background: transparent !important;
        border: none !important;
    }
    
    .sidebar-menu li a i { margin-right: 0; margin-bottom: 4px; font-size: 1.2rem; }
    .sidebar-menu li.active a { color: #2563eb; font-weight: 800; }

    /* Fix Main Content Overlap */
    .main-content {
        margin-left: 0 !important;
        width: 100%;
        padding: 15px !important;
        padding-bottom: 85px !important; 
    }

    .top-bar { flex-direction: column; align-items: flex-start; gap: 15px; }
    .exam-card { flex-direction: column; text-align: center; align-items: center; }
    .btn-start-exam, .btn-outline { width: 100%; margin-top: 10px; text-align: center; justify-content: center; }

    /* =========================================
       Exam Pages & History Card Mobile Fixes 
    ========================================= */
    .history-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .history-card > div { width: 100%; }
    .history-card .score-box {
        display: flex; justify-content: space-between; align-items: center;
        width: 100%; border-top: 1px dashed #cbd5e1; padding-top: 12px;
        margin-top: 5px; text-align: left;
    }
    
    /* FIX: This will NOW ONLY apply to Mobile screens */
    .tabs-container {
        flex-direction: column;
        gap: 8px;
        background: transparent;
        border: none;
        padding: 0;
    }
    .tab-btn { width: 100%; background: white; border: 1px solid #e2e8f0; }
} 
/* <-- Ehi bracket ta bahut zaruri thila jaha miss heijaithila! */