/* ==========================================================================
   infopopai.com — Main Stylesheet
   Light theme · Mobile-first · CSS Custom Properties
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
    --color-primary: #1F3A5F;
    --color-primary-light: #E9F0F7;
    --color-primary-dark: #162D4A;
    --color-secondary: #2E5C8A;
    --color-secondary-light: #5A8AB5;
    --color-bg: #ffffff;
    --color-bg-alt: #F6F5F2;
    --color-bg-hero: linear-gradient(135deg, #1B2A3A, #1F3A5F, #2E5C8A);
    --color-text: #212121;
    --color-text-light: #757575;
    --color-border: #E0E0E0;
    --color-card-shadow: rgba(0, 0, 0, 0.08);
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --max-width: 1200px;
    --radius: 12px;
    --radius-sm: 8px;
}

/* --------------------------------------------------------------------------
   2. Reset / Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

ul,
ol {
    list-style: none;
}

/* --------------------------------------------------------------------------
   3. Header / Nav (.site-header)
   -------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
}

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--color-primary);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-links a {
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

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

.nav-links a.active {
    color: var(--color-primary);
    font-weight: 600;
}

/* Hamburger — hidden on desktop */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--color-text);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

/* --------------------------------------------------------------------------
   4. Hero (.hero)
   -------------------------------------------------------------------------- */
.hero {
    background: var(--color-bg-hero);
    color: #ffffff;
    padding: 80px 24px;
    text-align: center;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.15;
}

.hero p {
    font-size: 1.25rem;
    max-width: 700px;
    margin: 0 auto;
    opacity: 0.9;
    line-height: 1.5;
}

.hero-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    padding: 8px 20px;
    font-size: 0.875rem;
    margin-bottom: 24px;
}

/* --------------------------------------------------------------------------
   5. Section (.section)
   -------------------------------------------------------------------------- */
.section {
    padding: 80px 24px;
}

.section-alt {
    background-color: var(--color-bg-alt);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
}

/* --------------------------------------------------------------------------
   6. Section Headers (.section-header)
   -------------------------------------------------------------------------- */
.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 12px;
}

.section-header p {
    color: var(--color-text-light);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   7. Cards (.card)
   -------------------------------------------------------------------------- */
.card {
    background-color: var(--color-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 12px var(--color-card-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.card-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background-color: var(--color-bg-alt);
}

.card-body {
    padding: 20px;
}

.card-title {
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 8px;
}

.card-text {
    color: var(--color-text-light);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   8. Grid Layouts
   -------------------------------------------------------------------------- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.grid-6 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 24px;
}

/* --------------------------------------------------------------------------
   9. Buttons (.btn)
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
    line-height: 1.4;
}

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

.btn-primary:hover {
    background-color: var(--color-primary-dark);
}

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

.btn-secondary:hover {
    background-color: #1F3A5F;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.btn-outline:hover {
    background-color: var(--color-primary);
    color: #ffffff;
}

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

.btn-white:hover {
    background-color: #E9F0F7;
}

.btn-lg {
    padding: 16px 36px;
    font-size: 1.125rem;
}

/* --------------------------------------------------------------------------
   10. Category Cards (.category-card)
   -------------------------------------------------------------------------- */
.category-card {
    text-align: center;
    padding: 32px 24px;
    background-color: var(--color-bg);
    border-radius: var(--radius);
    box-shadow: 0 2px 12px var(--color-card-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.category-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--color-bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 2rem;
}

.category-title {
    font-weight: 600;
    margin-bottom: 8px;
}

.category-count {
    font-size: 0.875rem;
    color: var(--color-text-light);
}

/* --------------------------------------------------------------------------
   11. Product Cards (.product-card)
   -------------------------------------------------------------------------- */
.product-card {
    background-color: var(--color-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 12px var(--color-card-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.product-card img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    background-color: var(--color-bg-alt);
}

.product-info {
    padding: 16px;
}

.product-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.product-meta {
    font-size: 0.8rem;
    color: var(--color-text-light);
}

/* --------------------------------------------------------------------------
   12. Badge / Tag (.badge)
   -------------------------------------------------------------------------- */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
}

.badge-primary {
    background-color: #E9F0F7;
    color: #1F3A5F;
}

.badge-free {
    background-color: #E8F5E9;
    color: #2E7D32;
}

/* --------------------------------------------------------------------------
   13. Feature List (.features)
   -------------------------------------------------------------------------- */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
}

.feature-item {
    text-align: center;
}

.feature-item--left {
    text-align: left;
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.feature-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.feature-text {
    color: var(--color-text-light);
    line-height: 1.6;
}

/* --------------------------------------------------------------------------
   14. Gallery (.gallery)
   -------------------------------------------------------------------------- */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.gallery-item {
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.gallery-item img {
    width: 100%;
    display: block;
    transition: transform 0.3s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    padding: 8px 12px;
    font-size: 0.85rem;
    text-align: center;
}

/* --------------------------------------------------------------------------
   15. Lightbox (.lightbox)
   -------------------------------------------------------------------------- */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: var(--radius);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #ffffff;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
}

/* --------------------------------------------------------------------------
   16. Game Cards (.game-card)
   -------------------------------------------------------------------------- */
.game-card {
    background-color: var(--color-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 12px var(--color-card-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.game-preview {
    aspect-ratio: 16 / 9;
    background: var(--color-bg-hero);
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-info {
    padding: 24px;
}

.play-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 1rem;
    background-color: var(--color-secondary);
    color: #ffffff;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s;
}

.play-btn:hover {
    background-color: #1F3A5F;
}

/* --------------------------------------------------------------------------
   17. Footer (.site-footer)
   -------------------------------------------------------------------------- */
.site-footer {
    background-color: #1B2A3A;
    color: rgba(255, 255, 255, 0.7);
    padding: 64px 24px 24px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    max-width: var(--max-width);
    margin: 0 auto 40px;
}

.footer-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
}

.footer-col h4 {
    color: #ffffff;
    margin-bottom: 16px;
    font-size: 1rem;
}

.footer-col a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    display: block;
    padding: 4px 0;
    transition: color 0.2s;
}

.footer-col a:hover {
    color: #ffffff;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 24px;
    text-align: center;
    font-size: 0.875rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

/* --------------------------------------------------------------------------
   18. Stats Bar (.stats-bar)
   -------------------------------------------------------------------------- */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 48px;
    flex-wrap: wrap;
    padding: 40px 24px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1.2;
}

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

/* --------------------------------------------------------------------------
   19. Breadcrumb (.breadcrumb)
   -------------------------------------------------------------------------- */
.breadcrumb {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 24px;
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.breadcrumb a {
    color: var(--color-primary);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   20. Filter Bar (.filter-bar)
   -------------------------------------------------------------------------- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
    justify-content: center;
}

.filter-btn {
    padding: 8px 20px;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background-color: var(--color-bg);
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    font-family: var(--font-family);
}

.filter-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.filter-btn.active {
    background-color: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}

/* --------------------------------------------------------------------------
   21. Accordion (.accordion)
   -------------------------------------------------------------------------- */
.accordion-item {
    border-bottom: 1px solid var(--color-border);
}

.accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    cursor: pointer;
    font-weight: 600;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: var(--font-family);
    font-size: 1rem;
    color: var(--color-text);
}

.accordion-header::after {
    content: '＋';
    transition: transform 0.3s;
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-left: 16px;
}

.accordion-item.open .accordion-header::after {
    content: '−';
}

.accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-item.open .accordion-body {
    max-height: 1000px;
}

.accordion-body-inner {
    padding-bottom: 20px;
    color: var(--color-text-light);
    line-height: 1.6;
}

/* --------------------------------------------------------------------------
   22. Two-Column Layout (.two-col)
   -------------------------------------------------------------------------- */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

/* --------------------------------------------------------------------------
   23. CTA Section (.cta-section)
   -------------------------------------------------------------------------- */
.cta-section {
    background: var(--color-bg-hero);
    color: #ffffff;
    text-align: center;
    padding: 80px 24px;
    border-radius: var(--radius);
}

.cta-section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.cta-section p {
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto 24px;
    opacity: 0.9;
}

/* --------------------------------------------------------------------------
   24. Info Box (.info-box)
   -------------------------------------------------------------------------- */
.info-box {
    background-color: var(--color-bg-alt);
    border-left: 4px solid var(--color-primary);
    padding: 24px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 24px 0;
}

.info-box h4 {
    margin-bottom: 8px;
}

.info-box p {
    color: var(--color-text-light);
    line-height: 1.6;
}

/* --------------------------------------------------------------------------
   25. Scroll-to-Top (.scroll-top)
   -------------------------------------------------------------------------- */
.scroll-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--color-primary);
    color: #ffffff;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s, background-color 0.2s;
    z-index: 999;
}

.scroll-top:hover {
    background-color: var(--color-primary-dark);
}

.scroll-top.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Responsive — Tablet (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {

    /* Nav: show hamburger, collapse links */
    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        background-color: var(--color-bg);
        flex-direction: column;
        padding: 24px;
        gap: 16px;
        border-bottom: 1px solid var(--color-border);
        transform: translateY(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
    }

    .nav-open .nav-links {
        transform: translateY(0);
    }

    /* Hero */
    .hero {
        padding: 48px 24px;
    }

    /* Sections */
    .section {
        padding: 48px 24px;
    }

    /* Stats */
    .stats-bar {
        gap: 24px;
    }

    /* Two-column → single */
    .two-col {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    /* CTA */
    .cta-section {
        padding: 48px 24px;
    }
}

/* ==========================================================================
   Responsive — Small Mobile (max-width: 480px)
   ========================================================================== */
@media (max-width: 480px) {

    /* Hero */
    .hero {
        padding: 36px 16px;
    }

    .hero p {
        font-size: 1.05rem;
    }

    /* Sections */
    .section {
        padding: 36px 16px;
    }

    .section-header h2 {
        font-size: 1.625rem;
    }

    .section-header p {
        font-size: 1rem;
    }

    /* Stats */
    .stat-number {
        font-size: 2rem;
    }

    /* Footer */
    .site-footer {
        padding: 48px 16px 16px;
    }

    .footer-grid {
        gap: 24px;
    }

    /* Buttons */
    .btn-lg {
        padding: 14px 28px;
        font-size: 1rem;
    }

    /* CTA */
    .cta-section {
        padding: 36px 16px;
    }

    .cta-section h2 {
        font-size: 1.625rem;
    }

    /* Cards */
    .card-body {
        padding: 16px;
    }

    .game-info {
        padding: 16px;
    }
}
