/* ==========================================================
   SIM2TRACK.RACING - MAIN PUBLIC STYLESHEET (Dark / Neon Phygital)
   ========================================================== */

:root {
    --bg-dark: #0b0e14;
    --bg-surface: #121824;
    --bg-card: rgba(22, 30, 46, 0.75);
    --border-color: rgba(255, 255, 255, 0.08);
    --primary-color: #00d26a; /* Racing Neon Green */
    --primary-hover: #00b359;
    --accent-color: #ff3344; /* Apex Red */
    --accent-hover: #e62233;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --font-stack: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body.site-public {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-stack);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ================= HEADER & NAVIGAZIONE DESKTOP ================= */
.public-nav {
    background: rgba(11, 14, 20, 0.92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 76px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    font-size: 1.55rem;
    font-weight: 900;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.brand-logo span {
    color: var(--primary-color);
}

/* Elementi Mobile: Nascosti di default su Desktop */
.mobile-toggle-btn,
.mobile-close-btn,
.mobile-nav-header,
.mobile-nav-auth,
.mobile-nav-overlay {
    display: none !important;
}

/* Navigazione Desktop Orizzontale */
.nav-links {
    display: flex !important;
    align-items: center;
    gap: 4px;
}

.nav-item {
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 14px;
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
}

.nav-item:hover {
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.03);
}

.nav-auth {
    display: flex !important;
    align-items: center;
    gap: 10px;
}

/* ================= BOTTONI & COMPONENTI BASE ================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    padding: 10px 22px;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
    font-size: 0.95rem;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 210, 106, 0.3);
}

.btn-accent {
    background-color: var(--accent-color);
    color: #fff;
}

.btn-accent:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 51, 68, 0.35);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: #fff;
}

.btn-outline:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1.05rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-full {
    width: 100%;
}

.glass-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    backdrop-filter: blur(16px);
}

/* ================= HERO SECTION ================= */
.hero-section {
    padding: 80px 0 60px;
    background: radial-gradient(circle at top right, rgba(0, 210, 106, 0.12) 0%, transparent 65%);
}

.hero-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 48px;
    align-items: center;
}

.badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 210, 106, 0.12);
    color: var(--primary-color);
    border: 1px solid rgba(0, 210, 106, 0.3);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

.hero-title {
    font-size: 3.2rem;
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -1px;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 48px;
    flex-wrap: wrap;
}

.hero-stats-bar {
    display: flex;
    align-items: center;
    gap: 28px;
    border-top: 1px solid var(--border-color);
    padding-top: 28px;
    flex-wrap: wrap;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
}

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

.stat-separator {
    width: 1px;
    height: 36px;
    background: var(--border-color);
}

/* ================= WIDGET SFIDA GHOST (DANIELE) ================= */
.challenge-card {
    padding: 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 51, 68, 0.35);
}

.challenge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.live-indicator {
    color: var(--accent-color);
    font-weight: 800;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.track-badge {
    background: rgba(255, 255, 255, 0.06);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.challenge-body h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.challenge-driver, .challenge-vehicle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.challenge-driver strong, .challenge-vehicle span {
    color: #fff;
}

.chrono-display {
    background: #000;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin: 20px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chrono-time {
    font-family: monospace;
    font-size: 2.6rem;
    font-weight: 900;
    color: var(--primary-color);
    display: block;
    letter-spacing: 2px;
}

.chrono-unit {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 1.5px;
}

.challenge-reward {
    font-size: 0.9rem;
    color: #ffd700;
    margin-bottom: 24px;
    font-weight: 500;
}

/* ================= METODO IN 3 STEP ================= */
.section-method {
    padding: 80px 24px;
}

.section-header {
    margin-bottom: 48px;
}

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

.sub-heading {
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    display: block;
    margin-bottom: 8px;
}

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

.step-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    position: relative;
    transition: transform 0.25s;
}

.step-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.2);
}

.step-icon {
    font-size: 2rem;
    margin-bottom: 16px;
}

.step-card h3 {
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.step-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.step-count {
    position: absolute;
    top: 24px;
    right: 24px;
    font-size: 1.6rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.1);
}

/* ================= EVENTI & TRACK DAYS ================= */
.section-events {
    padding: 80px 0;
    background: var(--bg-surface);
}

.events-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.event-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 260px;
}

.event-type-badge {
    display: inline-block;
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.type-sim_race { background: rgba(0, 210, 106, 0.15); color: var(--primary-color); }
.type-kart_endurance { background: rgba(255, 170, 0, 0.15); color: #ffaa00; }
.type-track_day { background: rgba(255, 51, 68, 0.15); color: var(--accent-color); }
.type-coaching { background: rgba(0, 150, 255, 0.15); color: #0096ff; }

.event-info h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.event-circuit, .event-date {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.event-meta {
    margin-top: 14px;
    font-size: 0.85rem;
    display: flex;
    gap: 16px;
    color: var(--text-muted);
}

.event-meta strong {
    color: #fff;
}

.event-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.event-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
}

/* ================= RANKING TABLE ================= */
.section-ranking {
    padding: 80px 24px;
}

.ranking-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.leaderboard-table-wrapper {
    padding: 24px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th, .leaderboard-table td {
    padding: 14px 16px;
    text-align: left;
}

.leaderboard-table th {
    font-size: 0.8rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
}

.leaderboard-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.95rem;
}

.apr-cell {
    font-weight: 800;
    color: var(--primary-color);
    font-family: monospace;
    font-size: 1.1rem;
}

.rank-pos {
    font-weight: 800;
    color: var(--text-muted);
}

.top-row td {
    background: rgba(0, 210, 106, 0.06);
}

.lvl-badge {
    background: rgba(255, 255, 255, 0.06);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.text-right {
    text-align: right;
}

/* ================= SEZIONE B2B & CORPORATE ================= */
.section-b2b {
    padding: 0 0 80px;
}

.b2b-grid {
    padding: 48px;
    display: grid;
    grid-template-columns: 1.4fr 0.6fr;
    gap: 32px;
    align-items: center;
    border-left: 4px solid var(--accent-color);
}

.sub-heading-accent {
    color: var(--accent-color);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    display: block;
    margin-bottom: 8px;
}

.b2b-features {
    list-style: none;
    margin: 20px 0 28px;
}

.b2b-features li {
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.b2b-metric-box {
    background: #000;
    padding: 32px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.b2b-num {
    font-size: 3rem;
    font-weight: 900;
    color: var(--accent-color);
    display: block;
}

.b2b-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ================= FOOTER ================= */
.public-footer {
    background: #07090e;
    border-top: 1px solid var(--border-color);
    padding: 60px 0 40px;
}

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

.footer-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 14px;
    max-width: 320px;
}

.public-footer h4 {
    margin-bottom: 16px;
    font-size: 1rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

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

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

.legal-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

/* ================= RESPONSIVE MOBILE (< 992px & < 768px) ================= */
@media (max-width: 992px) {
    .hero-container, 
    .ranking-split, 
    .b2b-grid, 
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .steps-grid {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 2.4rem;
    }

    /* Mostra il pulsante hamburger su mobile */
    .mobile-toggle-btn {
        display: inline-flex !important;
        background: transparent;
        border: none;
        color: #fff;
        font-size: 1.6rem;
        cursor: pointer;
        padding: 6px;
        align-items: center;
        justify-content: center;
    }

    /* Nasconde la barra auth orizzontale su mobile */
    .nav-auth {
        display: none !important;
    }

    /* Il menu centrale diventa un Drawer laterale scorrevole */
    .nav-links {
        display: flex !important;
        position: fixed;
        top: 0;
        left: -320px;
        width: 290px;
        height: 100vh;
        background: #0f141f;
        flex-direction: column;
        align-items: flex-start;
        padding: 24px 20px;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.7);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 9999;
        overflow-y: auto;
    }

    .nav-links.mobile-open {
        left: 0 !important;
    }

    .mobile-nav-header {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding-bottom: 16px;
        margin-bottom: 16px;
        border-bottom: 1px solid var(--border-color);
    }

    .mobile-close-btn {
        display: inline-block !important;
        background: transparent;
        border: none;
        color: #fff;
        font-size: 1.4rem;
        cursor: pointer;
        padding: 4px;
    }

    .nav-item {
        width: 100%;
        padding: 12px 10px;
        font-size: 1.05rem;
        border-radius: 8px;
    }

    .mobile-nav-auth {
        display: flex !important;
        flex-direction: column;
        gap: 12px;
        width: 100%;
        margin-top: auto;
        padding-top: 24px;
        border-top: 1px solid var(--border-color);
    }

    .mobile-nav-overlay.active {
        display: block !important;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 40px 0;
    }

    .hero-title {
        font-size: 2rem;
    }

    .chrono-time {
        font-size: 2rem;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .hero-stats-bar {
        gap: 16px;
    }

    .stat-separator {
        display: none;
    }

    .b2b-grid {
        padding: 24px;
    }
}