/* CSS Variables for Dark Mode Only */
:root {
    --bg-color: #2c2b2b;
    --text-color: #FFFFFF;
    --text-muted: rgba(255, 255, 255, 0.65);
    --primary-color: #BB86FC;
    --secondary-color: #3700B3;
    --nav-bg: rgba(44, 43, 43, 0.85);
    --card-bg: rgba(255, 255, 255, 0.05);
    /* Surface */
    --border-color: rgba(255, 255, 255, 0.12);
    --accent: #03DAC6;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --hover-shadow: 0 0 35px rgba(187, 134, 252, 0.2);
    /* Primary glow */
    --glow-color: rgba(187, 134, 252, 0.05);
    --card-hover-border: rgba(187, 134, 252, 0.4);
    --tag-bg: rgba(3, 218, 198, 0.1);
    --tag-border: rgba(3, 218, 198, 0.2);
    --transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --radius: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color var(--transition), color var(--transition);
    line-height: 1.6;
    background-image: radial-gradient(circle at 50% 0%, var(--glow-color), transparent 60%);
    background-size: 100% 100vh;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Header */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--secondary-color);
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    margin: 0 1rem;
    font-weight: 600;
    transition: color var(--transition);
}

.nav-links a:hover {
    color: var(--primary-color);
}

.actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Buttons */
button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.btn-primary {
    background: #3700b3;
    color: #fff;
    padding: 0.5rem 1.4rem;
    font-weight: 700;
    border-radius: 50px;
    /* Modern pill shape */
    font-size: 0.95rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
    opacity: 0.9;
}

.btn-create {
    padding: 0.45rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 40px;
    border: none;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.btn-create:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
    filter: brightness(1.1);
}

.btn-create.quiz {
    background: #3301a7;
}

/* Vivid Blue */
.btn-create.worldcup {
    background: #B8860B;
}

/* Amber */
.btn-create.tier {
    background: #663399;
}

/* Purple */

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.5rem 1.2rem;
    font-weight: 600;
    border-radius: 50px;
}

.btn-secondary:hover {
    border-color: var(--text-color);
    transform: translateY(-2px);
}

.btn-danger {
    background: #ef4444;
    color: #fff;
    padding: 0.5rem 1.2rem;
    font-weight: 600;
    border-radius: 50px;
}

.btn-danger:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

.large {
    padding: 0.8rem 1.5rem;
    font-size: 1.1rem;
}

.btn-icon {
    font-size: 1.2rem;
    background: transparent;
    color: var(--text-color);
}



/* Ad Placeholders */
.ad-placeholder {
    background: var(--card-bg);
    border: 2px dashed var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-weight: 600;
    text-align: center;
}

.top-ad,
.bottom-ad {
    width: 100%;
    max-width: 900px;
    height: 90px;
    margin: 1rem auto;
    border-radius: 8px;
}

.top-ad.compact {
    height: 60px;
    font-size: 0.8rem;
}

.side-ad {
    width: 210px;
    /* Adjusted to 70% of 300px */
    min-width: 150px;
    height: 600px;
    border-radius: 8px;
    position: sticky;
    top: 100px;
    font-size: 0.8rem;
}

/* Layout */
.container {
    max-width: 2080px;
    /* Increased by 30% from 1600px */
    margin: 0 auto;
    padding: 0 1.5rem;
}

.content-layout {
    display: flex;
    gap: 2rem;
    margin-top: 3rem;
}

.main-sections {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

/* Hero */
.hero {
    text-align: center;
    padding: 5rem 1rem;
    background: radial-gradient(circle at 50% 50%, rgba(76, 110, 245, 0.1), transparent 70%);
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(90deg, var(--primary-color), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Sections & Cards */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.section-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.08);
    position: relative;
    flex-shrink: 0;
    transition: all var(--transition);
}

[data-theme="light"] .section-icon {
    background: rgba(0, 0, 0, 0.05);
}

.section-icon svg {
    width: 1.6rem;
    height: 1.6rem;
    filter: drop-shadow(0 0 10px currentColor);
}

.icon-quiz {
    color: #3b82f6;
}

/* Vivid Blue */
.icon-worldcup {
    color: #fbbf24;
}

/* Amber Gold */
.icon-tier {
    color: #a855f7;
}

/* Purple */

.section-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 0 25px currentColor;
    opacity: 0.15;
    transition: opacity var(--transition);
}

.category-section:hover .section-icon {
    transform: scale(1.1) rotate(-5deg);
}

.category-section:hover .section-icon::after {
    opacity: 0.5;
}

.badge {
    background: var(--secondary-color);
    color: #fff;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 800;
}

.view-all {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: color 0.2s ease;
}

.view-all:hover {
    color: var(--text-color);
}

.view-all .arrow {
    transition: transform 0.2s ease;
}

.view-all:hover .arrow {
    transform: translateX(3px);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    overflow: hidden;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.8rem;
}

.card-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    gap: 0.5rem;
}

.card-stats span {
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 3px;
}

.success-rate {
    color: var(--primary-color);
}

.ranking-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #FFD700;
    color: #000;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.4);
}

.hot-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #EF4444;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
}

.card-image {
    position: relative;
    height: 140px;
    width: 100%;
}

.card-content {
    padding: 0.8rem 0.7rem;
}

.card-content h3 {
    font-size: 1rem;
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-content p {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--hover-shadow);
    border-color: var(--card-hover-border);
}



.tag {
    background: var(--tag-bg);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    border: 1px solid var(--tag-border);
}

/* Footer */
footer {
    background: var(--card-bg);
    padding: 2rem;
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
}

.footer-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
}

.footer-links a {
    color: var(--text-muted);
    margin-left: 1rem;
    text-decoration: none;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
}

@media (max-width: 1200px) {
    .card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .content-layout {
        flex-direction: column;
    }

    .side-ad {
        width: 100%;
        height: 90px;
        position: static;
        margin-bottom: 2rem;
    }
}

@media (max-width: 768px) {

    /* 모바일 네비게이션 정리 */
    .navbar {
        flex-wrap: wrap;
        padding: 1rem;
        gap: 1rem;
    }

    .nav-links {
        order: 3;
        width: 100%;
        display: flex;
        justify-content: center;
        gap: 1rem;
    }

    .nav-links a {
        margin: 0;
        font-size: 0.95rem;
    }

    /* 텍스트 크기 모바일 최적화 */
    .section-header h2 {
        font-size: 1.4rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .search-container input {
        padding: 1rem 1.5rem !important;
        font-size: 0.95rem !important;
    }

    /* 푸터 모바일 최적화 */
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .footer-links {
        display: flex;
        justify-content: center;
        gap: 1rem;
    }

    .footer-links a {
        margin: 0;
    }
}

@media (max-width: 600px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    .card-content {
        padding: 0.8rem;
    }

    .card-content h3 {
        font-size: 0.9rem;
    }
}

/* Quiz Option States */
.correct {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #ffffff !important;
}

.wrong {
    background-color: #ef4444 !important;
    /* 빨간색 계열 */
    border-color: #ef4444 !important;
    color: #ffffff !important;
}