/**
 * main.css
* Main Stylesheet for Online Examination System
 * study.rkutumb.in
 */

/* ========================================
   ROOT VARIABLES
   ======================================== */
:root {
    --primary-color: #4285F4;
    --secondary-color: #34A853;
    --warning-color: #FBBC04;
    --danger-color: #EA4335;
    --dark-color: #202124;
    --light-color: #F8F9FA;
    --text-color: #3C4043;
    --border-color: #DADCE0;
    --shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
/* ========================================
   CRITICAL VISIBILITY FIX
   ======================================== */



/* ========================================
   RESET & BASE STYLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    height: 100%;
}

body {
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: var(--light-color);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ========================================
   LOADING SPINNER
   ======================================== */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.3s ease;
}

.loader-overlay.hidden {
    display: none;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #4285F4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;  /* Space between spinner and text */
}

.loader-overlay p {
    color: #333;
    font-size: 16px;
    font-weight: 500;
    margin: 0;
    /* NO rotation animation here! */
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   NAVIGATION BAR
   ======================================== */
/* ========================================
   ENHANCED NAVIGATION BAR
   ======================================== */
.navbar {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 30px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-logo {
    height: 45px;
    width: auto;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 8px;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: #4b5563;
    font-weight: 500;
    font-size: 15px;
    padding: 10px 18px;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.nav-link:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.08);
}

.nav-link.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.12);
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.nav-link i {
    font-size: 16px;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* ===== USER DROPDOWN MENU - FINAL PROFESSIONAL VERSION ===== */
/* ===== USER DROPDOWN MENU - COMPLETE WORKING VERSION ===== */
.user-dropdown {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    cursor: pointer !important;
    padding: 8px 14px !important;
    border-radius: 14px !important;
    transition: all 0.3s ease !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.9) 100%) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

.user-dropdown:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.12) 100%) !important;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.2) !important;
    transform: translateY(-1px) !important;
}

.user-avatar {
    width: 46px !important;
    height: 46px !important;
    border-radius: 14px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    font-weight: 700 !important;
    font-size: 19px !important;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35) !important;
    position: relative !important;
    transition: all 0.3s ease !important;
}

.user-dropdown:hover .user-avatar {
    transform: scale(1.08) rotate(-3deg) !important;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.45) !important;
}

.user-name {
    font-weight: 600 !important;
    color: #1f2937 !important;
    font-size: 15px !important;
    letter-spacing: -0.2px !important;
}

/* CRITICAL: Bridge area */
.user-dropdown::after {
    content: '' !important;
    position: absolute !important;
    top: 100% !important;
    left: -20px !important;
    right: -20px !important;
    height: 20px !important;
    background: transparent !important;
    z-index: 1000 !important;
    pointer-events: auto !important;
}

.dropdown-menu {
    position: absolute !important;
    top: calc(100% + 4px) !important;
    right: -10px !important;
    background: white !important;
    border-radius: 20px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12), 0 8px 24px rgba(102, 126, 234, 0.15) !important;
    min-width: 300px !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-12px) scale(0.96) !important;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    z-index: 1001 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    display: none !important;
}

/* Show dropdown */
.user-dropdown:hover .dropdown-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
    pointer-events: auto !important;
    display: block !important;
}

.dropdown-menu:hover {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
    pointer-events: auto !important;
    display: block !important;
}

/* Beautiful gradient header */
.dropdown-header {
    padding: 28px 24px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    position: relative !important;
    overflow: hidden !important;
    border-radius: 20px 20px 0 0 !important;
}

.dropdown-header::before {
    content: '' !important;
    position: absolute !important;
    top: -50% !important;
    right: -50% !important;
    width: 200% !important;
    height: 200% !important;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%) !important;
    animation: shimmer 3s infinite !important;
}

@keyframes shimmer {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20px, -20px); }
}

.dropdown-header .user-name {
    font-weight: 700 !important;
    color: white !important;
    font-size: 19px !important;
    margin: 0 0 6px 0 !important;
    display: block !important;
    letter-spacing: -0.4px !important;
    position: relative !important;
    z-index: 1 !important;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

.dropdown-header .user-email {
    font-size: 14px !important;
    color: rgba(255, 255, 255, 0.9) !important;
    margin: 0 !important;
    display: block !important;
    word-break: break-all !important;
    font-weight: 500 !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Menu items */
.dropdown-menu a,
.dropdown-menu button {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    padding: 16px 24px !important;
    color: #374151 !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    border: none !important;
    background: white !important;
    width: 100% !important;
    text-align: left !important;
    cursor: pointer !important;
    font-size: 15px !important;
    font-family: var(--font-family) !important;
    font-weight: 500 !important;
    position: relative !important;
    overflow: hidden !important;
}

.dropdown-menu a::before,
.dropdown-menu button::before {
    content: '' !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 0 !important;
    height: 100% !important;
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%) !important;
    transition: width 0.4s ease !important;
    z-index: 0 !important;
}

.dropdown-menu a:hover::before,
.dropdown-menu button:hover::before {
    width: 100% !important;
}

.dropdown-menu a::after,
.dropdown-menu button::after {
    content: '' !important;
    position: absolute !important;
    left: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 4px !important;
    height: 0 !important;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%) !important;
    border-radius: 0 4px 4px 0 !important;
    transition: height 0.3s ease !important;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
    color: #667eea !important;
    padding-left: 32px !important;
}

.dropdown-menu a:hover::after,
.dropdown-menu button:hover::after {
    height: 36px !important;
}

/* Icon styling */
.dropdown-menu a i,
.dropdown-menu button i {
    font-size: 18px !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #6b7280 !important;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%) !important;
    border-radius: 12px !important;
    transition: all 0.4s ease !important;
    flex-shrink: 0 !important;
    position: relative !important;
    z-index: 1 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

.dropdown-menu a:hover i,
.dropdown-menu button:hover i {
    color: white !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    transform: scale(1.15) rotate(-8deg) !important;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4) !important;
}

/* Divider */
.dropdown-divider {
    height: 2px !important;
    background: linear-gradient(90deg, transparent 0%, rgba(102, 126, 234, 0.15) 20%, rgba(118, 75, 162, 0.15) 80%, transparent 100%) !important;
    margin: 12px 24px !important;
    position: relative !important;
    border: none !important;
}

/* Logout button */
.dropdown-menu .logout {
    color: #ef4444 !important;
    font-weight: 600 !important;
    margin-top: 6px !important;
    background: linear-gradient(90deg, #ffffff 0%, #fef2f2 100%) !important;
}

.dropdown-menu .logout::before {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.08) 0%, rgba(220, 38, 38, 0.08) 100%) !important;
}

.dropdown-menu .logout::after {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%) !important;
}

.dropdown-menu .logout:hover {
    color: #dc2626 !important;
    background: linear-gradient(90deg, #fef2f2 0%, #fee2e2 100%) !important;
}

.dropdown-menu .logout i {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%) !important;
    color: #ef4444 !important;
}

.dropdown-menu .logout:hover i {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: white !important;
    transform: scale(1.15) rotate(8deg) !important;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4) !important;
}

/* Chevron */
.user-dropdown .fa-chevron-down {
    transition: transform 0.4s ease !important;
    font-size: 12px !important;
    color: #6b7280 !important;
    margin-left: 4px !important;
}

.user-dropdown:hover .fa-chevron-down {
    transform: rotate(180deg) !important;
    color: #667eea !important;
}

/* Menu item text */
.dropdown-menu a span,
.dropdown-menu button span {
    position: relative !important;
    z-index: 1 !important;
}
/* ========================================
   BUTTONS
   ======================================== */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
}

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

.btn-secondary {
    background-color: var(--light-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: #fff;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-success {
    background-color: var(--secondary-color);
    color: #fff;
}

.btn-success:hover {
    background-color: #2D8E47;
    transform: translateY(-2px);
}

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

.btn-danger:hover {
    background-color: #D33B2C;
}

.btn-login {
    padding: 0.5rem 1.5rem;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 24px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-login:hover {
    background-color: #3367D6;
    transform: scale(1.05);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ========================================
   MAIN CONTENT
   ======================================== */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 200px);
    display: block;
    width: 100%;
}

html, body {
    height: 100%;
    width: 100%;
}

.section {
    display: none;
    padding: 2rem 0;
    min-height: 400px;
}

.section.active {
    display: block;
}

.section-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 2rem;
    color: var(--dark-color);
}

/* ========================================
   HERO SECTION
   ======================================== */
.hero-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    padding: 4rem 0;
    min-height: 500px; /* ADD THIS - prevents collapse */
}

.hero-content {
    min-height: 300px; /* INCREASE THIS */
}

.hero-image {
    min-height: 300px; /* ADD THIS */
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-image img {
    width: 100%;
    height: auto;
    max-width: 500px;
    min-height: 200px; /* ADD THIS - prevents collapse if image fails */
}
.features-section {
    padding: 4rem 0;
    min-height: 400px; /* INCREASE THIS */
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-color);
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}



/* ========================================
   FEATURES SECTION
   ======================================== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.feature-card p {
    color: var(--text-color);
}

/* ========================================
   EXAMS GRID
   ======================================== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.filters {
    display: flex;
    gap: 1rem;
}

.filter-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 1rem;
    background-color: #fff;
    cursor: pointer;
    transition: var(--transition);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.exams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.exam-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
}

.exam-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.exam-card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    padding: 1.5rem;
}

.exam-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.exam-card-subtitle {
    font-size: 0.875rem;
    opacity: 0.9;
}

.exam-card-body {
    padding: 1.5rem;
}

.exam-info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.exam-card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ========================================
   EXAM TAKING INTERFACE
   ======================================== */
.exam-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 2rem;
}

.exam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 2rem;
}

.exam-timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    background-color: var(--light-color);
    border-radius: 8px;
}

.question-navigator {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: var(--light-color);
    border-radius: 8px;
}

.nav-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.nav-button {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    background-color: #fff;
    color: var(--text-color);
}

.nav-button:hover {
    transform: scale(1.1);
}

.nav-button.answered {
    background-color: var(--secondary-color);
    color: #fff;
}

.nav-button.current {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.3);
}

.legend {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.badge {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-block;
}

.badge-answered {
    background-color: var(--secondary-color);
}

.badge-current {
    background-color: var(--primary-color);
}

.badge-unattempted {
    background-color: #fff;
    border: 2px solid var(--border-color);
}

.question-container {
    padding: 2rem;
    min-height: 400px;
}

.question-text {
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.question-image {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
    border-radius: 8px;
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.option:hover {
    border-color: var(--primary-color);
    background-color: rgba(66, 133, 244, 0.05);
}

.option.selected {
    border-color: var(--primary-color);
    background-color: rgba(66, 133, 244, 0.1);
}

.option input[type="radio"] {
    margin-right: 1rem;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.option-label {
    font-weight: 500;
    margin-right: 0.5rem;
}

.exam-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

/* ========================================
   RESULTS
   ======================================== */
.results-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.result-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    transition: var(--transition);
    cursor: pointer;
}

.result-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.result-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--dark-color);
}

.result-grade {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
}

.grade-a {
    background-color: #E8F5E9;
    color: #2E7D32;
}

.grade-b {
    background-color: #E3F2FD;
    color: #1565C0;
}

.grade-c {
    background-color: #FFF3E0;
    color: #E65100;
}

.grade-f {
    background-color: #FFEBEE;
    color: #C62828;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.stat-box {
    text-align: center;
    padding: 1rem;
    background-color: var(--light-color);
    border-radius: 8px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-color);
}

/* ========================================
   LEADERBOARD
   ======================================== */
.leaderboard-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table thead {
    background-color: var(--primary-color);
    color: #fff;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 1rem;
    text-align: left;
}

.leaderboard-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.leaderboard-table tbody tr:hover {
    background-color: var(--light-color);
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-weight: 600;
}

.rank-1 {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #fff;
}

.rank-2 {
    background: linear-gradient(135deg, #C0C0C0, #808080);
    color: #fff;
}

.rank-3 {
    background: linear-gradient(135deg, #CD7F32, #8B4513);
    color: #fff;
}

/* ========================================
   PROFILE
   ======================================== */
.profile-container {
    max-width: 800px;
    margin: 0 auto;
}

.profile-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 2rem;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background-color: var(--light-color);
    border-radius: 8px;
}

.stat-item .stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color);
}

.stat-item .stat-label {
    font-size: 0.875rem;
    color: var(--text-color);
}

/* ========================================
   FORMS
   ======================================== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: 1rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

/* ========================================
   MODAL
   ======================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex !important;
}

.modal-content {
    background-color: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-small {
    max-width: 400px;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-color);
}

.modal-close:hover {
    color: var(--danger-color);
}

/* ========================================
   TOAST NOTIFICATION
   ======================================== */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--dark-color);
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 3000;
    display: none;
    animation: slideInRight 0.3s ease;
}

.toast.show {
    display: block;
}

.toast.success {
    background-color: var(--secondary-color);
}

.toast.error {
    background-color: var(--danger-color);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
    background-color: var(--dark-color);
    color: #fff;
    padding: 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: #fff;
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 1rem;
}

.hidden {
    display: none !important;
}



/**
 * ADMIN PANEL STYLES
 * Add this to your main.css file
 */

/* ==========================================
   ADMIN DASHBOARD
   ========================================== */

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.admin-header h1 {
    margin: 0;
    color: var(--primary-color);
}

.admin-header p {
    margin: 0.5rem 0 0 0;
    color: var(--text-secondary);
}

/* Admin Stats Cards */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.stat-card i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

.stat-card h3 {
    font-size: 2rem;
    margin: 0.5rem 0;
}

.stat-card p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

/* Admin Actions */
.admin-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.admin-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Admin Content */
.admin-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.admin-content h2 {
    margin-top: 0;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

/* Exams List */
.exams-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-exam-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
}

.admin-exam-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.admin-exam-card .exam-info h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.admin-exam-card .exam-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.admin-exam-card .exam-actions {
    display: flex;
    gap: 0.5rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

/* ==========================================
   ADMIN MODAL
   ========================================== */

#adminModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    overflow-y: auto;
    padding: 2rem;
}

#adminModal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

#adminModalContent {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

#adminModalContent h2 {
    margin-top: 0;
    color: var(--primary-color);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Image Upload & Preview */
input[type="file"] {
    padding: 0.5rem;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
}

.image-preview {
    margin-top: 1rem;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    background: #f8f9fa;
}

.image-preview img {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.image-preview p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ==========================================
   QUESTIONS MANAGEMENT
   ========================================== */

.questions-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.question-card {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    background: white;
    transition: all 0.3s ease;
}

.question-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.question-num {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.question-text {
    font-size: 1.1rem;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.question-img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    margin: 1rem 0;
}

.question-options {
    display: grid;
    gap: 0.75rem;
    margin: 1rem 0;
}

.question-options .option {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.question-options .option.correct {
    background: #d4edda;
    border-color: #28a745;
    font-weight: 600;
}

.question-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* ==========================================
   BULK IMPORT
   ========================================== */

.bulk-import-section {
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 1rem 0;
}

#csvPreview {
    margin-top: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.csv-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.csv-table th,
.csv-table td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.csv-table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.csv-table tr:hover {
    background: #f8f9fa;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .admin-exam-card {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .admin-exam-card .exam-actions {
        margin-top: 1rem;
        width: 100%;
    }
    
    .admin-actions {
        flex-direction: column;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    #adminModalContent {
        padding: 1rem;
        margin: 1rem;
    }
}

@media (max-width: 480px) {
    .admin-stats {
        grid-template-columns: 1fr;
    }
}
