* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, sans-serif;
    background: #f5f7fb;
    color: #1e293b;
    line-height: 1.4;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    background: rgba(255,255,255,0.96);
}
header .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.logo {
        font-size: 1.7rem;
        font-weight: 900;
        background: linear-gradient(90deg, #ff7a18, #af00ff, #2563eb, #06b6d4);
        background-size: 300% 300%;
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        animation: gradientMove 6s linear infinite;
        text-decoration: none;
        display: inline-block;
        padding: 2px 6px;
        border-radius: 8px;
        transition: transform 0.2s ease, filter 0.2s ease;
}
@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
.logo:hover { transform: translateY(-3px); filter: drop-shadow(0 6px 18px rgba(34,197,94,0.12)); }

/* Top-left small links next to logo */
.left-area { display: flex; flex-direction: column; gap: 6px; }
.top-links { font-size: 0.85rem; display:flex; gap:12px; align-items:center; }
.top-links a { text-decoration:none; color:#475569; font-weight:600; }
.top-links a:hover { color:#2563eb; }

/* Make sure logo link inherits styles and is clickable */
.logo { cursor: pointer; }
nav {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
nav a {
    margin-left: 0;
    text-decoration: none;
    color: #334155;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 6px 10px;
    white-space: nowrap;
    flex: 0 0 auto;
}
nav a:hover { color: #1e40af; }
/* hide horizontal scrollbar (non-intrusive) */
nav::-webkit-scrollbar { height: 6px; }
nav::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 10px; }
nav { scrollbar-width: thin; scrollbar-color: rgba(0,0,0,0.08) transparent; }

/* nav toggle (hamburger) for small screens */
.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: #0f172a;
    padding: 6px 8px;
}

/* mobile behavior: hide nav, show toggle; nav opens as dropdown */
@media (max-width: 820px) {
    .nav-toggle { display: inline-flex; }
    /* On small screens, show first few category links inline and hide the rest into the hamburger */
    nav { display: flex; position: relative; right: 0; top: 0; background: transparent; border-radius: 0; box-shadow: none; flex-direction: row; padding: 0; min-width: 0; z-index: 1; }
    /* hide 5th+ links (keep first 4 visible) */
    nav a:nth-child(n+5) { display: none; }
    body.nav-open nav { display: flex; }
    nav a { padding: 10px 12px; }
    header { position: sticky; top: 0; z-index: 1300; }
}

/* When nav is opened via hamburger, show all links as dropdown */
body.nav-open nav {
    position: absolute;
    right: 16px;
    top: 64px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(2,6,23,0.12);
    flex-direction: column;
    padding: 10px;
    min-width: 220px;
    z-index: 1200;
}
body.nav-open nav a { display: block; padding: 10px 12px; }

/* Buttons */
.btn-primary {
    display: inline-block;
    background: #2563eb;
    color: white;
    padding: 12px 28px;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(37,99,235,0.2);
}
.btn-primary:hover { background: #1d4ed8; transform: translateY(-2px); }

.btn-outline {
    display: inline-block;
    border: 1.5px solid #2563eb;
    color: #2563eb;
    padding: 8px 20px;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 600;
    background: white;
    transition: 0.2s;
}
.btn-outline:hover { background: #2563eb; color: white; }

.btn-small {
    display: inline-block;
    background: #f1f5f9;
    color: #1e293b;
    padding: 8px 16px;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
}
.btn-small:hover { background: #e2e8f0; }

/* Hero / Trending Card */
.hero {
    margin: 32px 0;
}
.trending-card {
    background: linear-gradient(135deg, #ffffff, #f0f9ff);
    border-radius: 28px;
    padding: 28px 24px;
    text-align: center;
    box-shadow: 0 18px 40px rgba(14,30,77,0.08), 0 6px 18px rgba(37,99,235,0.06);
    border: 1px solid rgba(37,99,235,0.06);
    max-width: 980px;
    margin: 0 auto;
}
.trending-badge {
    background: #fef3c7;
    color: #b45309;
    padding: 6px 14px;
    border-radius: 40px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 16px;
}
.trending-card h2 {
    font-size: 2.1rem;
    margin-bottom: 10px;
    font-weight: 800;
    color: #0f172a;
}
.trending-card p {
    color: #334155;
    margin-bottom: 20px;
    font-size: 1rem;
}
.play-count {
    margin-top: 18px;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 600;
}

.trending-card .btn-primary {
    background: linear-gradient(90deg, #2563eb, #7c3aed);
    padding: 14px 34px;
    font-size: 1.05rem;
    box-shadow: 0 10px 30px rgba(37,99,235,0.18);
}

/* Make hero image area more prominent */
.quiz-featured-img { border-radius: 18px; max-height: 360px; object-fit: cover; }

/* Ads */
.ad-container {
    margin: 36px 0;
    text-align: center;
}
.ad-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    margin-bottom: 8px;
}
.ad-placeholder {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 24px 16px;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.ad-leaderboard { min-height: 90px; }
.ad-rectangle { min-height: 250px; background: #fafcff; }
.ad-sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
    padding: 8px;
    z-index: 1000;
    text-align: center;
    border-top: 1px solid #eef2ff;
}

/* Most Popular & Category Sections */
.most-popular, .category-section {
    margin: 48px 0;
}
h2 {
    font-size: 1.7rem;
    margin-bottom: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
h2:before {
    content: '';
    width: 6px;
    height: 28px;
    background: #7c3aed;
    border-radius: 10px;
    display: inline-block;
}
.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
}
.quiz-card {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    transition: 0.2s;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    border: 1px solid #edf2f7;
}
.quiz-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}
.quiz-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.quiz-card h4 {
    font-size: 1.2rem;
    margin: 18px 18px 8px;
    font-weight: 700;
}
.quiz-card p {
    margin: 0 18px 12px;
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.4;
}
.quiz-card .play-count-sm {
    margin: 0 18px 12px;
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
}
.quiz-card .btn-small {
    margin: 0 18px 20px;
    text-align: center;
    display: inline-block;
}

/* Make the whole tile clickable via wrapper link */
.quiz-tile-link { text-decoration: none; color: inherit; display: inline-block; }
.quiz-card { display: flex; flex-direction: column; align-items: center; }
.quiz-card img { border-radius: 12px; width: 100%; height: 180px; object-fit: cover; }
.quiz-card h4 { margin: 12px 16px 6px; }
.quiz-card p { margin: 0 16px 10px; }
.quiz-card .play-count-sm { margin-bottom: 8px; }

/* Start button styling */
.btn-start {
    display: inline-block;
    background: linear-gradient(90deg,#10b981,#06b6d4);
    color: #fff;
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none;
    margin: 10px 0 18px;
    box-shadow: 0 8px 20px rgba(16,185,129,0.12);
}
.btn-start:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(6,182,212,0.14); }

/* Tile hover color accent */
.quiz-card:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(2,6,23,0.12); background: linear-gradient(180deg,#ffffff,#fbfbff); }

/* Hero blurred background element */
.hero { position: relative; padding: 40px 0 28px; overflow: hidden; }
.hero .hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; filter: blur(8px) brightness(0.65); transform: scale(1.04); z-index: 0; }
.trending-card, .trending-card * { position: relative; z-index: 2; }

/* Quiz Page (quiz.html) specific */
.quiz-featured-img {
    width: 100%;
    border-radius: 32px;
    margin: 20px 0;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}
.scroll-trigger {
    text-align: center;
    margin: 40px 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1d4ed8;
    cursor: pointer;
    background: #bfdbfe;
    border: 1px solid #93c5fd;
    display: inline-block;
    width: auto;
    padding: 14px 34px;
    border-radius: 60px;
    box-shadow: 0 10px 30px rgba(59,130,246,0.16);
}
#quizSection {
    margin: 28px 0;
    min-height: 150px;
}
.quiz-placeholder {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    color: #64748b;
    border-radius: 24px;
    padding: 28px;
    text-align: center;
    font-size: 1rem;
}
.question-card {
    background: white;
    border-radius: 32px;
    padding: 28px;
    margin-bottom: 28px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.03);
    border: 1px solid #eef2ff;
}
.question-img {
    width: 100%;
    border-radius: 24px;
    margin-bottom: 20px;
}
.question-text {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 28px;
    line-height: 1.3;
}
.answers-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.answer-btn {
    background: #fafcff;
    border: 1px solid #e2e8f0;
    padding: 18px 20px;
    border-radius: 60px;
    font-size: 1rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 12px;
}
.answer-btn:before {
    content: attr(data-letter);
    font-weight: 800;
    background: #eef2ff;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 40px;
    color: #2563eb;
}
.answer-btn:hover {
    background: #f1f5f9;
    border-color: #2563eb;
    transform: scale(1.01);
}
.progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
    margin: 20px 0;
    overflow: hidden;
}
.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #7c3aed);
    transition: width 0.3s;
}
.analysis-screen {
    text-align: center;
    padding: 70px 20px;
    background: white;
    border-radius: 48px;
    margin: 30px 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.04);
}
.share-options {
    margin-top: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 24px;
}
.share-options.hidden {
    display: none;
}
.share-buttons-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    margin-top: 16px;
}
.share-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 999px;
    font-weight: 700;
    color: white;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.share-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(15,23,42,0.08);
}
.share-button.fb { background: #1877f2; }
.share-button.wa { background: #25d366; }
.share-button.tg { background: #0088cc; }
.share-button.tw { background: #1da1f2; }
.share-button.copy { background: #334155; }
.share-note {
    margin-top: 16px;
    color: #475569;
    font-size: 0.95rem;
}
.analysis-screen h2 {
    font-size: 1.8rem;
    margin-bottom: 12px;
}
.analysis-screen p {
    color: #64748b;
}
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 24px auto;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.result-card {
    background: white;
    border-radius: 36px;
    padding: 32px;
    text-align: center;
    margin: 20px 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.04);
}
.result-card img {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 20px;
    border: 4px solid #7c3aed20;
}
.result-card h2 {
    font-size: 2rem;
    margin-bottom: 16px;
}
.result-card p {
    font-size: 1rem;
    color: #334155;
    margin-bottom: 28px;
}
.result-card button {
    margin: 8px;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin: 28px 0;
}

/* Footer */
footer {
    margin-top: 70px;
    padding: 48px 0 90px;
    background: white;
    border-top: 1px solid #eef2ff;
}
.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    justify-content: center;
    margin-bottom: 32px;
}
.footer-links a {
    text-decoration: none;
    color: #475569;
    font-size: 0.9rem;
}
.newsletter {
    text-align: center;
    margin: 32px 0;
}
.newsletter input {
    padding: 12px 18px;
    border-radius: 60px;
    border: 1px solid #cbd5e1;
    width: 260px;
    margin-right: 10px;
}
.newsletter button {
    background: #2563eb;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 60px;
    cursor: pointer;
    font-weight: 600;
}
.copyright {
    text-align: center;
    color: #94a3b8;
    font-size: 0.75rem;
}

@media (max-width: 640px) {
    .container { padding: 0 18px; }
    .trending-card h2 { font-size: 1.5rem; }
    .question-text { font-size: 1.3rem; }
    .answer-btn { padding: 14px 16px; }
    .quiz-grid { gap: 18px; }
    .newsletter input { width: 100%; margin-bottom: 10px; }
    .left-area { flex-direction: row; align-items: center; gap: 12px; }
    .top-links { display: none; }
}

/* Ensure desktop always shows nav links and hides hamburger explicitly */
@media (min-width: 821px) {
    nav { display: flex !important; position: static !important; box-shadow: none !important; }
    .nav-toggle { display: none !important; }
}

/* Ensure desktop always shows nav links and hides hamburger explicitly */
@media (min-width: 821px) {
    nav { display: flex !important; position: static !important; box-shadow: none !important; }
    .nav-toggle { display: none !important; }
}