/* =========================================
   1. CSS VARIABLES (For easy theme changes)
   ========================================= */
:root {
    --primary-blue: #1a237e;
    --accent-red: #ff6b6b;
    --text-dark: #333333;
    --text-light: #888888;
    --bg-main: #f8f9fa;
    --bg-footer: #2c3e50;
    --white: #ffffff;
    --border-color: #dddddd;
}

/* =========================================
   2. BASIC RESET
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-main);
}

/* =========================================
   3. HEADER & NAVBAR STYLING
   ========================================= */
header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 20px 40px;
}

.logo-container h1 {
    text-align: center;
    color: var(--primary-blue);
    font-size: 32px;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 25px;
}

.nav-links li a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 15px;
    transition: color 0.3s ease;
}

.nav-links li a:hover {
    color: var(--accent-red);
}

/* Authentication Buttons */
.auth-buttons button {
    padding: 8px 20px;
    margin-left: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s ease;
}

.login-btn {
    background-color: transparent;
    color: var(--primary-blue);
    border: 1px solid var(--primary-blue);
}

.login-btn:hover {
    background-color: var(--bg-main);
}

.register-btn {
    background-color: var(--primary-blue);
    color: var(--white);
}

.register-btn:hover {
    background-color: #121858;
    box-shadow: 0 4px 8px rgba(26, 35, 126, 0.3);
}

/* Logout Button Styling */
.logout-btn {
    background-color: #e74c3c;
    color: var(--white);
}

.logout-btn:hover {
    background-color: #c0392b;
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.3);
}

/* =========================================
   4. DROPDOWN MENUS (With Smooth Animation)
   ========================================= */
.dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.dropdown-content {
    visibility: hidden; 
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.3s ease;
    position: absolute;
    background-color: var(--white);
    min-width: 220px;
    box-shadow: 0px 8px 20px rgba(0,0,0,0.15);
    z-index: 100;
    top: 100%;
    left: 0;
    border-radius: 8px;
    overflow: hidden;
    margin-top: 5px;
}

.dropdown:hover .dropdown-content {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-content a {
    color: var(--text-dark);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    border-bottom: 1px solid #f1f1f1;
    transition: all 0.2s ease;
}

.dropdown-content a:hover {
    background-color: var(--bg-main);
    color: var(--primary-blue);
    font-weight: 600;
    padding-left: 20px;
}

/* =========================================
   5. MAIN CONTENT & SEARCH BAR (Modern UI)
   ========================================= */
main {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 120px 20px;
    position: relative;
    
    /* Premium Tech Dot-Grid Background */
    background-color: #f8fafc; /* Subtle slate off-white */
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 24px 24px;
    overflow: hidden;
}

/* Subtle Glowing Orb Animation behind the search bar */
main::before {
    content: "";
    position: absolute;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, rgba(255, 107, 107, 0.05) 40%, rgba(255, 255, 255, 0) 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 0;
    pointer-events: none;
    animation: pulseGlow 8s infinite alternate;
}

@keyframes pulseGlow {
    0% { transform: translate(-50%, -50%) scale(1); }
    100% { transform: translate(-50%, -50%) scale(1.1); opacity: 0.8; }
}

/* Search Container Update */
.search-container {
    display: flex;
    width: 100%;
    max-width: 800px;
    background: rgba(255, 255, 255, 0.9); /* Glassmorphism feel */
    backdrop-filter: blur(10px);
    border-radius: 50px; 
    box-shadow: 0 15px 35px rgba(0,0,0,0.05), 0 5px 15px rgba(0,0,0,0.03);
    border: 1px solid rgba(255, 255, 255, 0.8);
    overflow: hidden; 
    position: relative; /* Orb ke upar rakhne ke liye */
    z-index: 1;
    transition: all 0.3s ease;
}

.search-container:focus-within {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 15px 40px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.search-input {
    flex-grow: 1;
    padding: 22px 30px;
    font-size: 18px;
    border: none;
    outline: none;
    background: transparent;
    color: #1e293b;
    font-weight: 500;
}

.search-input::placeholder {
    color: #94a3b8;
}

.search-action-btn {
    background: linear-gradient(135deg, #e60000, #cc0000); /* Premium Gradient Red */
    color: #ffcc00; 
    border: none;
    padding: 0 45px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.5px;
}

.search-action-btn:hover {
    background: linear-gradient(135deg, #cc0000, #990000);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    main { padding: 80px 20px; }
    .search-container {
        flex-direction: column;
        border-radius: 15px;
        background: transparent;
        box-shadow: none;
        border: none;
        backdrop-filter: none;
    }
    .search-input {
        border-radius: 12px;
        margin-bottom: 15px;
        background: rgba(255, 255, 255, 0.95);
        box-shadow: 0 8px 20px rgba(0,0,0,0.08);
        border: 1px solid rgba(255, 255, 255, 0.5);
    }
    .search-action-btn {
        border-radius: 12px;
        padding: 18px;
        justify-content: center;
        box-shadow: 0 8px 20px rgba(204, 0, 0, 0.25);
    }
}

/* =========================================
   6. FOOTER STYLING
   ========================================= */
footer {
    background-color: var(--bg-footer);
    color: var(--white);
    padding: 25px;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 15px;
}

.footer-links a {
    color: #ecf0f1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent-red);
    text-decoration: none;
}

.copyright p {
    font-size: 14px;
    color: #bdc3c7;
}

/* =========================================
   7. MODAL STYLING (Popup Form)
   ========================================= */
.modal {
    display: none; 
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); 
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--white);
    padding: 30px 40px;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    position: relative;
    text-align: center;
    animation: fadeIn 0.3s ease-out; 
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* YAHAN BUG FIX KIYA HAI: Dono close buttons add kiye hain */
.close-btn, .close-login-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-light);
    transition: 0.2s;
}

.close-btn:hover, .close-login-btn:hover { 
    color: var(--accent-red); 
}

.modal-content h2 {
    color: var(--primary-blue);
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 15px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-dark);
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    outline: none;
    font-size: 15px;
}

.input-group input:focus { border-color: var(--primary-blue); }

.submit-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-blue);
    color: var(--white);
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    transition: 0.3s;
}

.submit-btn:hover { background-color: #121858; }

.message { margin-top: 15px; font-weight: bold; font-size: 14px; }
.success-msg { color: #2ecc71; } 
.error-msg { color: #e74c3c; } 

/* =========================================
   8. GOOGLE LOGIN BUTTON STYLING
   ========================================= */
.google-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--white);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.google-btn:hover {
    background-color: #f1f3f4;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.google-icon {
    width: 20px;
    height: 20px;
}

/* =========================================
   9. PROFILE DASHBOARD STYLES
   ========================================= */
.stats-grid {
    display: flex;
    gap: 20px;
    justify-content: space-between;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    flex: 1;
    text-align: center;
    border-bottom: 4px solid var(--accent-red);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h3 {
    color: var(--text-light);
    font-size: 16px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card h2 {
    color: var(--primary-blue);
    font-size: 36px;
    margin: 0;
}

/* Table Hover Effect */
tbody tr:hover {
    background-color: #f1f3f4;
}

@media (max-width: 768px) {
    .stats-grid {
        flex-direction: column;
    }
}

/* =========================================
   10. LIVE SEARCH ENGINE RESULTS
   ========================================= */
.search-wrapper-relative {
    position: relative;
    width: 100%;
    max-width: 800px;
    z-index: 10; /* Cards ke upar dikhne ke liye */
}

.search-results {
    position: absolute;
    top: 105%; /* Search bar ke theek neeche */
    left: 0;
    width: 100%;
    background: white;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    max-height: 300px;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.search-results.hidden {
    display: none;
}

.search-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none;
    color: #1e293b;
    transition: background 0.2s ease;
}

.search-item:last-child { border-bottom: none; }
.search-item:hover { background: #f8fafc; }
.search-item i { margin-right: 15px; color: #3b82f6; font-size: 18px; }
.search-item-title { font-weight: bold; font-size: 16px; margin-bottom: 4px; display: block;}
.search-item-desc { font-size: 13px; color: #64748b; }

/* =========================================
   11. POPULAR CARDS SECTION
   ========================================= */
main {
    flex-direction: column; /* Allows stacking search and cards vertically */
    justify-content: flex-start;
}

.explore-section {
    width: 100%;
    max-width: 1100px;
    margin-top: 60px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.section-title {
    color: #1a237e;
    font-size: 28px;
    margin-bottom: 40px;
    font-weight: bold;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.exam-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px 20px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.exam-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.card-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 30px;
    margin-bottom: 20px;
}

.exam-card h3 { color: #1e293b; margin: 0 0 15px 0; font-size: 22px; }
.exam-card p { color: #64748b; font-size: 15px; line-height: 1.6; margin-bottom: 25px; flex-grow: 1; }

.card-btn {
    text-decoration: none;
    background: #3b82f6;
    color: white;
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: bold;
    transition: opacity 0.3s;
    width: 100%;
}
.card-btn:hover { opacity: 0.8; }

@media (max-width: 768px) {
    .cards-grid { grid-template-columns: 1fr; }
}

/* =========================================
   12. HOME PAGE EXPANSION (Minimalist)
   ========================================= */
.hall-of-fame-home {
    width: 100%;
    max-width: 1100px;
    margin: 80px auto;
    text-align: center;
}

.results-ticker {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.result-badge {
    background: #1a237e;
    color: #ffcc00; /* Matching your YouTube branding */
    padding: 15px 25px;
    border-radius: 12px;
    font-weight: 900;
    font-size: 22px;
    box-shadow: 0 10px 20px rgba(26, 35, 126, 0.2);
    border: 1px solid rgba(255, 204, 0, 0.3);
}

.trust-text {
    color: #64748b;
    font-weight: 500;
    font-size: 16px;
}

.features-minimal {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-bottom: 100px;
    padding: 20px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1a237e;
    font-weight: 600;
    font-size: 15px;
}

.feature-item i {
    color: #2ecc71;
}

@media (max-width: 768px) {
    .features-minimal { flex-direction: column; gap: 20px; align-items: center; }
}