/* ===================================================================
   BBallStats — Dark "Pro Sport Analytics" Theme
   Shared stylesheet for all static pages (index, changelog, priv, war, funkcje, instrukcja)
   =================================================================== */

/* --- Font Faces --- */
@font-face {
    font-family: 'Inter';
    src: url('/fonts/inter-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('/fonts/inter-bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* --- Design Tokens --- */
:root {
    --bg-primary: #0B132B;
    --bg-secondary: #1C2541;
    --bg-card: #162038;
    --accent: #FF6B35;
    --accent-hover: #E55A2B;
    --text-primary: #FFFFFF;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    --border: #2D3A5C;
    --nav-height: 60px;
    --max-width: 1100px;
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-height) + 20px);
}

body {
    font-family: var(--font);
    font-weight: 400;
    line-height: 1.7;
    color: var(--text-secondary);
    background-color: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-hover); }

/* --- Utility --- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ===================================================================
   NAVIGATION (sticky header)
   =================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-height);
    background: rgba(11, 19, 43, .92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.logo svg { width: 32px; height: 32px; }

/* Nav links */
.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
}
.nav-links a {
    color: var(--text-secondary);
    font-size: .9rem;
    font-weight: 500;
    transition: color .2s;
    white-space: nowrap;
}
.nav-links a:hover { color: var(--text-primary); }

/* Language toggle */
.lang-toggle {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: .8rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color .2s, color .2s;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.lang-toggle:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

/* Mobile hamburger */
.nav-hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
}
.nav-hamburger svg { width: 24px; height: 24px; }

/* Mobile menu */
.nav-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99;
    background: rgba(11, 19, 43, .96);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
}
.nav-mobile-overlay.open { display: flex; }
.nav-mobile-overlay a {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
}
.nav-mobile-overlay .lang-toggle {
    font-size: 1rem;
    padding: 8px 20px;
}
.nav-mobile-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}
.nav-mobile-close svg { width: 28px; height: 28px; }

/* ===================================================================
   HERO SECTION
   =================================================================== */
.hero {
    padding: 100px 0 80px;
    text-align: center;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}
.hero h1 {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 20px;
}
.hero .subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 620px;
    margin: 0 auto 40px;
    line-height: 1.7;
}
.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: background .2s, transform .15s, box-shadow .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 20px rgba(255, 107, 53, .3);
}
.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
    box-shadow: 0 6px 28px rgba(255, 107, 53, .4);
}
.btn-ghost {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* ===================================================================
   FEATURES SECTION
   =================================================================== */
.features {
    padding: 80px 0;
    background: var(--bg-secondary);
}
/* Tighter gap between Funkcje and Dostęp (same background block) */
#features {
    padding-bottom: 56px;
}
#access {
    padding-top: 56px;
}
.features .section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 60px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}
.feature-card {
    text-align: center;
    padding: 20px;
}
.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}
.feature-icon svg {
    width: 56px;
    height: 56px;
    color: var(--accent);
}
.feature-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}
.feature-card p {
    font-size: .95rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.features-lead {
    text-align: center;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 620px;
    margin: -40px auto 60px;
}

.features-grid--2 {
    grid-template-columns: repeat(2, 1fr);
    max-width: 900px;
    margin: 0 auto;
}

/* ===================================================================
   CHANGELOG / TIMELINE SECTION
   =================================================================== */
.changelog-section {
    padding: 80px 0;
    background: var(--bg-primary);
}
.changelog-section .section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 60px;
}

.timeline {
    position: relative;
    max-width: 780px;
    margin: 0 auto;
    padding-left: 40px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
}
.timeline-item:last-child { margin-bottom: 0; }

.timeline-dot {
    position: absolute;
    left: -40px;
    top: 4px;
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    border: 3px solid var(--bg-primary);
    box-shadow: 0 0 0 2px var(--accent);
}

.timeline-item h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.timeline-date {
    font-size: .85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.timeline-item ul {
    list-style: none;
    padding: 0;
}
.timeline-item li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 6px;
    font-size: .92rem;
    line-height: 1.6;
    color: var(--text-secondary);
}
.timeline-item li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

.changelog-more {
    text-align: center;
    margin-top: 48px;
}

/* ===================================================================
   SUBPAGE CONTENT (changelog full, priv, war)
   =================================================================== */
.page-content {
    padding: 40px 0 80px;
    min-height: calc(100vh - var(--nav-height) - 160px);
}
.page-content .container { max-width: 820px; }

.page-content h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.changelog-intro {
    margin-top: 0;
    margin-bottom: 28px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.page-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 40px;
    margin-bottom: 16px;
}
.page-content h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 32px;
    margin-bottom: 12px;
}
.page-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 24px;
    margin-bottom: 8px;
}
.page-content p {
    margin-bottom: 16px;
    line-height: 1.7;
}
.page-content ul {
    padding-left: 24px;
    margin-bottom: 16px;
}
.page-content li {
    margin-bottom: 8px;
    line-height: 1.6;
}
.page-content strong { color: var(--text-primary); }
.page-content code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: .9em;
    color: var(--accent);
}
.page-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 32px 0;
}
.page-content .effective-date {
    color: var(--text-muted);
    font-style: italic;
    font-size: .95rem;
}

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 24px;
    font-size: .9rem;
    color: var(--text-secondary);
}
.back-link:hover { color: var(--accent); }

.page-content table.features-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0 24px;
    font-size: .95rem;
}
.page-content table.features-table th,
.page-content table.features-table td {
    padding: 10px 14px;
    text-align: left;
    border: 1px solid var(--border);
    vertical-align: top;
}
.page-content table.features-table th {
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 600;
}
.page-content table.features-table td { color: var(--text-secondary); }
.page-content .features-doc-toc { margin-bottom: 48px; }
.page-content .features-doc-toc ol { padding-left: 24px; }
.page-content .features-doc-toc li { margin-bottom: 8px; }
.page-content .features-doc-toc a { color: var(--text-secondary); font-weight: 500; }
.page-content .features-doc-toc a:hover { color: var(--accent); }
.page-content .features-doc-section { margin-bottom: 48px; }
.page-content .features-doc-section > h2 {
    margin-top: 56px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.page-content .features-doc-section:first-of-type > h2 {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}
.page-content .features-doc-lead {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.75;
}

/* ===================================================================
   FOOTER
   =================================================================== */
.site-footer {
    padding: 40px 0;
    border-top: 1px solid var(--border);
    background: var(--bg-primary);
    text-align: center;
}
.site-footer p {
    font-size: .85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.7;
}
.footer-links {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 8px;
}
.footer-links a {
    font-size: .85rem;
    color: var(--text-secondary);
    transition: color .2s;
}
.footer-links a:hover { color: var(--accent); }

/* ===================================================================
   SCROLL ANIMATIONS
   =================================================================== */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .6s ease-out, transform .6s ease-out;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===================================================================
   RESPONSIVE
   =================================================================== */

/* Tablet */
@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }
    .hero { padding: 80px 0 60px; }
    .hero h1 { font-size: 2.2rem; }
    .features { padding: 60px 0; }
    #features { padding-bottom: 36px; }
    #access { padding-top: 36px; }
    .changelog-section { padding: 60px 0; }
    .page-content h1 { font-size: 1.7rem; }

    .features-grid--2 { grid-template-columns: 1fr; }

    .nav-links { display: none; }
    .nav-hamburger { display: block; }
}

/* Phone */
@media (max-width: 480px) {
    .features-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .hero { padding: 60px 0 48px; }
    .hero h1 { font-size: 1.7rem; }
    .hero .subtitle { font-size: 1rem; }
    .hero-buttons { flex-direction: column; align-items: center; }
    .btn { width: 100%; max-width: 280px; justify-content: center; }

    .container { padding: 0 16px; }

    .timeline { padding-left: 32px; }
    .timeline-dot { left: -32px; width: 14px; height: 14px; }

    .features .section-title,
    .changelog-section .section-title {
        font-size: 1.6rem;
        margin-bottom: 40px;
    }
    .page-content h1 { font-size: 1.5rem; }
}
