/* ============================================================
   raceteam.wiki — Dark theme, checkered flag aesthetic
   ============================================================ */

:root {
    --bg: #0a0a0a;
    --bg-card: #141414;
    --bg-card-hover: #1a1a1a;
    --bg-section: #111111;
    --bg-input: #1a1a1a;
    --border: #222222;
    --border-hover: #333333;
    --text: #f0f0f0;
    --text-secondary: #999999;
    --text-muted: #666666;
    --red: #e63e12;
    --red-hover: #ff4d1a;
    --blue: #5b9aff;
    --green: #34d399;
    --yellow: #fbbf24;
    --purple: #a78bfa;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Manrope', 'Inter', sans-serif;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --max-width: 1200px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--red); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--red-hover); }

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

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

/* ============ HEADER ============ */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10,10,10,0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text);
    text-decoration: none;
}
.logo:hover { color: var(--text); }
.logo-accent { color: var(--red); }
.logo-flag { font-size: 1.5rem; }

.nav-links {
    display: flex;
    list-style: none;
    gap: 4px;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); background: var(--bg-card); }

.nav-cta {
    background: var(--red) !important;
    color: #fff !important;
    font-weight: 600 !important;
}
.nav-cta:hover { background: var(--red-hover) !important; }

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    width: 44px;
    height: 44px;
}

/* ============ HERO ============ */
.hero {
    text-align: center;
    padding: 80px 20px 60px;
    background: linear-gradient(180deg, var(--bg-section) 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--border);
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 16px;
}
.hero h1 .accent { color: var(--red); }

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 32px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 32px;
}

.hero-stat {
    text-align: center;
}
.hero-stat .number {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: var(--red);
}
.hero-stat .label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Search bar */
.search-wrapper {
    max-width: 560px;
    margin: 0 auto;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text);
    font-size: 1rem;
    font-family: var(--font-body);
    outline: none;
    transition: border-color 0.2s;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus { border-color: var(--red); }

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0; right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 50;
    box-shadow: var(--shadow);
}
.search-results.open { display: block; }

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    transition: background 0.15s;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-card-hover); color: var(--text); }

.search-result-type {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.search-result-name { font-weight: 600; font-size: 0.9375rem; }
.search-result-meta { font-size: 0.8125rem; color: var(--text-secondary); }

/* ============ SECTIONS ============ */
.section { padding: 60px 0; }
.section-dark { background: var(--bg-section); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 32px;
}
.section-header h2 {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
}
.section-header a { font-size: 0.875rem; }

/* ============ CARD GRIDS ============ */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text);
    display: block;
}
.card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    color: var(--text);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.0625rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.card-meta {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.card-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-count {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--red);
}

/* Category tiles (homepage) */
.category-tile {
    text-align: center;
    padding: 28px 16px;
}
.category-tile .tile-icon { font-size: 2rem; margin-bottom: 8px; }
.category-tile .tile-name { font-weight: 700; font-size: 0.9375rem; margin-bottom: 4px; }
.category-tile .tile-count { font-size: 0.8125rem; color: var(--text-secondary); }

/* ============ BADGES ============ */
.badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 4px;
    line-height: 1;
}
.tier-karting { background: #2d1f0e; color: #fbbf24; }
.tier-club { background: #0e2d1a; color: #34d399; }
.tier-semipro { background: #1a1a2e; color: #818cf8; }
.tier-pro { background: #2d0e0e; color: #f87171; }
.tier-factory { background: #1a0e2d; color: #c084fc; }

.badge-active { background: #0e2d1a; color: #34d399; }
.badge-inactive { background: #1a1a1a; color: #666; }
.badge-claimed { background: #1d2d3a; color: #5b9aff; }

.badge-series {
    background: var(--bg);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    cursor: pointer;
}
.badge-series:hover { border-color: var(--red); color: var(--red); }

/* ============ TEAM PAGE ============ */
.team-hero {
    padding: 48px 0 32px;
    border-bottom: 1px solid var(--border);
}

.team-hero-inner {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

.team-logo-placeholder {
    width: 80px;
    height: 80px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.team-info h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.team-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.team-meta .separator { color: var(--text-muted); }

.team-badges { display: flex; flex-wrap: wrap; gap: 6px; }

.team-section {
    padding: 32px 0;
    border-bottom: 1px solid var(--border);
}
.team-section:last-of-type { border-bottom: none; }

.team-section h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
}

/* Social links bar */
.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.social-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
}
.social-link:hover { border-color: var(--red); color: var(--text); }

/* Claim CTA box */
.claim-box {
    background: linear-gradient(135deg, #1a0e0e, #0e1a1a);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    text-align: center;
    margin: 32px 0;
}
.claim-box h3 {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.claim-box p { color: var(--text-secondary); font-size: 0.875rem; margin-bottom: 16px; }

/* ============ SERIES PAGE ============ */
.series-hero {
    padding: 48px 0 32px;
    border-bottom: 1px solid var(--border);
}

.series-hero h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
}

/* Filter chips */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 24px;
}

.chip {
    padding: 6px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.chip:hover, .chip.active { border-color: var(--red); color: var(--red); background: rgba(230,62,18,0.08); }

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-hover); color: #fff; }

.btn-secondary { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--border-hover); background: var(--bg-card-hover); color: var(--text); }

/* ============ CITABILITY BLOCK ============ */
.citability-block {
    margin: 24px 0;
    padding: 20px;
    background: var(--bg-section);
    border-left: 3px solid var(--red);
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--text-secondary);
}
.citability-block h2 {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
}

/* ============ NETWORK GRID ============ */
.network-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.network-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
}
.network-card:hover { transform: translateY(-2px); border-color: var(--border-hover); color: var(--text); }
.network-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.network-card p { font-size: 0.8125rem; color: var(--text-secondary); }

/* ============ FOOTER ============ */
.footer {
    border-top: 1px solid var(--border);
    padding: 48px 0 24px;
    background: var(--bg-section);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}

.footer h3 {
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.footer-links { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: var(--text-muted); font-size: 0.875rem; }
.footer-links a:hover { color: var(--text); }

.footer-brand p { color: var(--text-secondary); font-size: 0.875rem; line-height: 1.6; margin-top: 12px; }

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.footer-sister-sites { display: flex; gap: 16px; }
.footer-sister-sites a { color: var(--text-muted); font-size: 0.75rem; }
.footer-sister-sites a:hover { color: var(--text); }

/* ============ DRIVER CARDS ============ */
.driver-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.driver-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 180px;
}
.driver-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.driver-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-section);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.driver-name { font-weight: 600; font-size: 0.9375rem; }

/* ============ CAR CARDS ============ */
.car-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.car-card {
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 200px;
}
.car-title { font-weight: 700; font-size: 0.9375rem; margin-bottom: 2px; }
.car-detail { font-size: 0.8125rem; color: var(--text-secondary); }

/* ============ SUPPORT TIERS ============ */
.support-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.support-card {
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.support-card:hover {
    border-color: var(--red);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.support-amount {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--green);
    margin-bottom: 4px;
}
.support-amount span { font-size: 0.875rem; font-weight: 500; color: var(--text-secondary); }
.support-name { font-weight: 700; font-size: 0.9375rem; margin-bottom: 6px; }
.support-desc { font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.5; }
.support-cta {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #0e1a0e, #0e1a1a);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.support-cta p { color: var(--text-secondary); font-size: 0.9375rem; margin-bottom: 8px; }
.support-cta p strong { color: var(--text); }
.support-cta .support-cta-detail { font-size: 0.8125rem; margin-bottom: 16px; }

/* ============ TEAM PHOTO ============ */
.team-photo { border-radius: var(--radius-lg); overflow: hidden; }
.team-photo img { width: 100%; max-height: 400px; object-fit: cover; display: block; }

/* ============ RELATED TEAMS ============ */
.related-teams { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

/* ============ ABOUT / SUBMIT ============ */
.content-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 48px 20px;
}
.content-page h1 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 16px;
}
.content-page p { color: var(--text-secondary); line-height: 1.7; margin-bottom: 16px; }
.content-page h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    margin: 32px 0 12px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-6 { grid-template-columns: repeat(3, 1fr); }
    .network-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
    .related-teams { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .hero { padding: 48px 20px 40px; }
    .hero-stats { gap: 24px; }
    .hero-stat .number { font-size: 1.5rem; }

    .mobile-menu-btn { display: flex; align-items: center; justify-content: center; }
    .nav-links {
        display: none;
        position: absolute;
        top: 64px; left: 0; right: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 12px;
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 12px 16px; width: 100%; }

    .grid-2, .grid-3, .grid-4, .grid-6 { grid-template-columns: 1fr; }
    .network-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .related-teams { grid-template-columns: 1fr; }
    .support-grid { grid-template-columns: repeat(2, 1fr); }
    .driver-grid, .car-grid { flex-direction: column; }
    .driver-card, .car-card { min-width: auto; }

    .team-hero-inner { flex-direction: column; }
    .team-info h1 { font-size: 1.5rem; }

    .section-header { flex-direction: column; gap: 8px; }

    .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
    .footer-sister-sites { flex-wrap: wrap; justify-content: center; }
}
