/*
Theme Name: Quizs Question
Theme URI: https://www.quizsquestion.com/
Author: Quizs Question
Author URI: https://www.quizsquestion.com/
Description: A custom 2D animation showcase and quiz theme.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: quizs-question
*/

/* 
   Paste the CSS from your HTML file below this line.
   I have included the CSS from your previous code below.
*/

/* --- VARIABLES & RESET --- */
:root {
    --primary: #4CAF50;
    --primary-dark: #388E3C;
    --secondary: #2196F3;
    --accent: #FF9800;
    --dark: #222222;
    --light: #f4f6f9;
    --white: #ffffff;
    --gray: #666666;
    --border: #e0e0e0;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --radius: 12px;
    
    /* Quiz Theme Variables */
    --ink: #1a1a1a;
    --ink-light: #5a5a5a;
    --paper: #faf8f3;
    --paper-warm: #f2efe6;
    --rule: #e0dbd0;
    --q-accent: #c8392b; 
    --success: #2d6a4f;
    --success-bg: #d8f3dc;
    --fail: #9b2335;
    --fail-bg: #ffe0e0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
img { max-width: 100%; height: auto; }
button { cursor: pointer; border: none; outline: none; font-family: inherit; }

/* --- HEADER AREA --- */
header { background: var(--white); box-shadow: 0 2px 10px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 1000; }

/* Top Utility Bar */
.top-bar { background: var(--dark); color: rgba(255,255,255,0.7); font-size: 0.85rem; padding: 8px 0; }
.top-bar .container { display: flex; justify-content: flex-end; gap: 20px; max-width: 1200px; margin: 0 auto; padding: 0 15px; }
.top-bar a:hover { color: var(--white); }

/* Main Header */
.header-main { padding: 1rem 0; border-bottom: 1px solid #eee; }
.header-main .container { display: flex; align-items: center; justify-content: space-between; position: relative; max-width: 1200px; margin: 0 auto; padding: 0 15px; }

.logo { font-size: 1.5rem; font-weight: 700; color: var(--dark); display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo span { color: var(--primary); }
.logo img { height: 45px; width: auto; }

/* Search Box */
#searchbox { flex: 1; margin: 0 30px; max-width: 500px; display: none; }
.Header-searchBox { display: flex; border: 1px solid #ddd; border-radius: 30px; overflow: hidden; background: #f9f9f9; }
.searchInput { border: none; padding: 10px 15px; flex: 1; outline: none; background: transparent; font-size: 14px; }
.searchButton { border: none; background: #347aae; color: #fff; padding: 0 20px; cursor: pointer; transition: 0.3s; }
.searchButton:hover { background: #2a5f8a; }

/* Auth Buttons */
.nav-menu { display: flex; gap: 15px; align-items: center; }
.btn-auth { padding: 8px 20px; border-radius: 50px; font-weight: 600; font-size: 0.9rem; transition: transform 0.2s; }
.btn-auth:hover { transform: translateY(-2px); }
.btn-login { border: 2px solid var(--primary); color: var(--primary); margin-right: 5px; }
.btn-login:hover { background: var(--primary); color: var(--white); }
.btn-signup { background: var(--primary); color: var(--white); }
.btn-signup:hover { background: var(--primary-dark); }

/* --- NAVIGATION BAR --- */
.main-nav { background: #2c3e50; color: #fff; position: relative; z-index: 999; border-bottom: 3px solid #F0FF18; }
.main-nav .container { display: flex; align-items: center; max-width: 1200px; margin: 0 auto; padding: 0 15px; }

.main-nav ul.nav-menu { display: flex; gap: 0; align-items: stretch; width: 100%; }
.main-nav .nav-menu > li { position: relative; }
.main-nav .nav-menu > li > a { 
    display: block; 
    padding: 15px 18px; 
    color: #fff; 
    font-weight: 500; 
    font-size: 15px;
    border-right: 1px solid rgba(255,255,255,0.05); 
    white-space: nowrap;
}
.main-nav .nav-menu > li:hover > a { background: #34495e; color: #F0FF18; }
.menu-active a { background: #34495e; color: #F0FF18 !important; }

/* Dropdowns */
.menu-has-children > a::after {
    content: '\f107'; font-family: FontAwesome; margin-left: 5px; font-size: 12px;
}
.menu-has-children > ul { 
    display: none; position: absolute; top: 100%; left: 0; background: #fff; min-width: 220px; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); z-index: 1000; border-top: 3px solid #F0FF18;
}
.menu-has-children:hover > ul { display: block; }
.menu-has-children > ul li { border-bottom: 1px solid #eee; }
.menu-has-children > ul li a { display: block; padding: 12px 20px; color: #333; font-size: 14px; }
.menu-has-children > ul li a:hover { background: #f9f9f9; color: #347aae; padding-left: 25px; }

/* Sub-menus */
.menu-has-children > ul > li { position: relative; }
.menu-has-children > ul > li > ul {
    display: none; position: absolute; top: 0; left: 100%; border-top: none; border-left: 3px solid #F0FF18;
}
.menu-has-children > ul > li:hover > ul { display: block; }

/* Mobile Menu Toggle */
.mobile-toggle { display: none; font-size: 1.5rem; color: var(--dark); background: none; }

/* --- HERO SECTION --- */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    padding: 5rem 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before, .hero::after {
    content: ''; position: absolute; border-radius: 50%; background: rgba(255,255,255,0.1);
}
.hero::before { width: 300px; height: 300px; top: -50px; left: -50px; }
.hero::after { width: 200px; height: 200px; bottom: 50px; right: -50px; }

.hero-content { position: relative; z-index: 2; max-width: 800px; margin: 0 auto; }
.hero h1 { font-size: 3rem; font-weight: 700; margin-bottom: 1.5rem; line-height: 1.2; font-family: 'Playfair Display', serif; }
.hero p { font-size: 1.2rem; margin-bottom: 2.5rem; opacity: 0.9; }

.hero-btns { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; }
.btn-large {
    padding: 12px 30px; border-radius: 8px; font-weight: 600; font-size: 1rem; 
    transition: all 0.3s ease; display: inline-flex; align-items: center; gap: 8px;
}
.btn-white { background: var(--white); color: var(--dark); }
.btn-white:hover { background: #f0f0f0; transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.2); }
.btn-outline { border: 2px solid rgba(255,255,255,0.3); color: var(--white); background: transparent; }
.btn-outline:hover { background: rgba(255,255,255,0.1); border-color: var(--white); }

/* --- STATS BAR --- */
.stats-bar { background: var(--white); display: flex; justify-content: space-around; padding: 2rem 1.5rem; box-shadow: 0 4px 20px rgba(0,0,0,0.05); position: relative; z-index: 10; margin-top: -30px; max-width: 1200px; margin-left: auto; margin-right: auto; border-radius: var(--radius); }
.stat-item { text-align: center; }
.stat-item h3 { font-size: 2rem; color: var(--primary); margin-bottom: 5px; }
.stat-item p { color: var(--gray); font-weight: 500; font-size: 0.9rem; }

/* --- MAIN LAYOUT --- */
.section-container { max-width: 1200px; margin: 4rem auto; padding: 0 1.5rem; }
.section-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem; }
.section-title h2 { font-size: 2rem; margin-bottom: 0.5rem; font-family: 'Playfair Display', serif; }
.section-title p { color: var(--gray); }
.view-all { color: var(--primary); font-weight: 600; display: flex; align-items: center; gap: 5px; }
.view-all:hover { gap: 8px; }

/* --- CONTEST CARDS --- */
.contest-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.contest-card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform 0.3s ease; position: relative; border: 1px solid var(--border); }
.contest-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.12); }

.contest-header { position: relative; height: 180px; overflow: hidden; }
.contest-header img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.contest-card:hover .contest-header img { transform: scale(1.1); }
.prize-tag { position: absolute; top: 15px; left: 15px; background: var(--accent); color: var(--white); padding: 5px 12px; border-radius: 4px; font-weight: 700; font-size: 0.8rem; }

.contest-body { padding: 1.5rem; }
.contest-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 1rem; }
.contest-meta { display: flex; gap: 15px; font-size: 0.85rem; color: var(--gray); margin-bottom: 1rem; }

.progress-bar { height: 6px; background: #eee; border-radius: 3px; overflow: hidden; margin-bottom: 1rem; }
.progress-fill { height: 100%; background: var(--secondary); width: 0%; transition: width 0.5s; }

.contest-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #eee; padding-top: 1rem; }
.participants { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--gray); }
.avatars { display: flex; }
.avatars img { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--white); margin-left: -10px; }
.avatars img:first-child { margin-left: 0; }

/* --- QUIZ GRID --- */
.featured-section { background: var(--paper); border-radius: 20px; box-shadow: var(--shadow); margin-bottom: 4rem; border: 1px solid var(--rule); padding: 2rem; }
.quiz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2rem; }

.quiz-card { background: transparent; cursor: pointer; transition: 0.3s; }
.quiz-card:hover .quiz-thumb { transform: scale(1.05); }
.quiz-thumb { width: 100%; height: 140px; object-fit: cover; border-radius: 12px; margin-bottom: 1rem; transition: 0.3s; }
.quiz-cat { color: var(--secondary); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; margin-bottom: 5px; }
.quiz-name { font-weight: 700; font-size: 1.1rem; margin-bottom: 5px; font-family: 'Playfair Display', serif; }
.quiz-stats { font-size: 0.85rem; color: var(--gray); }

/* --- LEADERBOARD --- */
.leaderboard-section { background: var(--dark); color: var(--white); padding: 4rem 1.5rem; }
.leaderboard-container { max-width: 800px; margin: 2rem auto 0; background: rgba(255,255,255,0.05); border-radius: var(--radius); overflow: hidden; }
.leader-row { display: flex; align-items: center; padding: 1.2rem; border-bottom: 1px solid rgba(255,255,255,0.1); transition: 0.2s; }
.leader-row:hover { background: rgba(255,255,255,0.1); }
.rank { font-size: 1.5rem; font-weight: 700; color: var(--accent); width: 50px; text-align: center; }
.user-info { display: flex; align-items: center; gap: 15px; flex: 1; }
.user-info img { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--accent); }
.score { font-weight: 700; color: var(--primary); }

/* --- FOOTER --- */
footer { background: #1a1a1a; color: #aaa; margin-top: auto; }
.footer-container { max-width: 1200px; margin: 0 auto; padding: 4rem 1.5rem 2rem; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; padding-bottom: 3rem; border-bottom: 1px solid #333; margin-bottom: 1.5rem; }
.footer-col h4 { color: var(--white); font-size: 1.1rem; margin-bottom: 1.5rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.footer-col a { display: block; color: #aaaaaa; text-decoration: none; margin-bottom: 0.8rem; font-size: 0.9rem; transition: all 0.3s ease; }
.footer-col a:hover { color: var(--primary); padding-left: 5px; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; color: #777777; }

/* --- QUIZ GAME MODAL --- */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); z-index: 2000; align-items: center; justify-content: center;
    backdrop-filter: blur(5px);
}
.modal-overlay.open { display: flex; animation: fadeIn 0.3s ease; }

.modal-content {
    background: var(--paper); width: 90%; max-width: 650px; border-radius: 8px;
    padding: 0; position: relative; box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease; border-top: 5px solid var(--q-accent);
    overflow: hidden;
}

.close-game { position: absolute; top: 15px; right: 20px; font-size: 1.8rem; cursor: pointer; color: var(--gray); z-index: 10; }
.close-game:hover { color: var(--dark); }

.game-header { padding: 1.5rem 2rem 0.5rem 2rem; border-bottom: 1px solid var(--rule); }
.progress-game { height: 6px; background: #eee; border-radius: 3px; overflow: hidden; margin-bottom: 10px; }
.progress-fill-game { height: 100%; background: var(--q-accent); width: 0%; transition: width 0.3s; }
.game-header h4 { color: var(--ink); font-family: 'Playfair Display', serif; font-weight: 700; }

.game-body { padding: 2rem; }
.question-text { font-size: 1.4rem; font-weight: 600; margin-bottom: 2rem; color: var(--ink); font-family: 'DM Sans', sans-serif; line-height: 1.4; }

.options-grid { display: grid; gap: 1rem; }
.option-btn {
    background: #fff; border: 2px solid var(--rule); padding: 1rem 1.25rem; border-radius: 6px;
    text-align: left; font-size: 1rem; transition: all 0.2s; font-weight: 500;
    display: flex; align-items: center; justify-content: space-between;
}
.option-btn:hover:not(:disabled) { background: #f0f0f0; border-color: #ccc; }

.option-btn.correct { background: var(--success-bg); border-color: var(--success); color: #0e522e; }
.option-btn.correct::after { content: '\f00c'; font-family: FontAwesome; margin-left: 10px; font-weight: bold; }

.option-btn.wrong { background: var(--fail-bg); border-color: var(--fail); color: #721c24; opacity: 0.8; }
.option-btn.wrong::after { content: '\f00d'; font-family: FontAwesome; margin-left: 10px; font-weight: bold; }
.option-btn:disabled { cursor: default; }

.game-result { text-align: center; display: none; padding: 3rem 2rem; }
.score-circle {
    width: 140px; height: 140px; border-radius: 50%; border: 5px solid var(--q-accent);
    margin: 0 auto 1.5rem; display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-size: 2.5rem; font-weight: 700; color: var(--ink); font-family: 'Playfair Display', serif;
    background: #fff;
}
.score-total { font-size: 1rem; color: var(--gray); font-family: 'Poppins', sans-serif; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* --- RESPONSIVE --- */
@media (min-width: 768px) {
    #searchbox { display: block; }
    .d-md-block { display: block; }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .mobile-toggle { display: block; }
    .stats-bar { flex-direction: column; gap: 2rem; }
    .section-header { flex-direction: column; align-items: flex-start; }
    .leader-row { padding: 1rem; }
    
    /* Mobile Nav */
    .main-nav ul.nav-menu { 
        flex-direction: column; display: none; position: absolute; top: 100%; left: 0; width: 100%; background: #2c3e50;
    }
    .main-nav ul.nav-menu.active { display: flex; }
    .main-nav .nav-menu > li { width: 100%; border-bottom: 1px solid rgba(255,255,255,0.05); }
    .menu-has-children > ul { position: static; width: 100%; box-shadow: none; border-top: none; background: #34495e; display: none; }
    .menu-has-children:hover > ul { display: block; }
    .menu-has-children > ul > li > ul { position: static; padding-left: 20px; display: none; }
    .menu-has-children > ul > li:hover > ul { display: block; }
    
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .footer-bottom { flex-direction: column; gap: 10px; text-align: center; }
}