:root {
    /* Paleta Dark Mode Sofisticada (Inspirada na F1) */
    --f1-red: #e10600;
    --f1-dark: #15151e; /* Fundo principal (Carbon) */
    --f1-card: #1f1f2a; /* Fundo dos cards */
    --f1-black: #ffffff; /* Texto principal invertido para branco */
    --f1-gray: #9ca3af; /* Texto secundário (cinza claro) */
    --f1-border: #2d2d3a; /* Bordas sutis */
    --f1-bg: #15151e;
    --f1-success: #10b981; /* Verde mais vibrante pro dark mode */
    --f1-danger: #ef4444; /* Vermelho erro/queda */
}

body {
    background: var(--f1-bg);
    color: var(--f1-black);
}

.f1-home {
    min-height: 100vh;
    background: radial-gradient(circle at top left, rgba(225, 6, 0, 0.08), transparent 40%), var(--f1-bg);
}

.pb-mobile-nav {
    padding-bottom: 90px;
}

.text-f1-red {
    color: var(--f1-red) !important;
}

/* =========================================
   CABEÇALHO E BRANDING
   ========================================= */
.brand-logo {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--f1-dark), #1f2937);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.brand-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--f1-black);
    line-height: 1.1;
}

.brand-subtitle {
    font-size: 0.88rem;
    color: var(--f1-gray);
}

.season-badge {
    display: inline-block;
    background: var(--f1-red);
    color: #fff;
    font-size: 0.75rem;
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 700;
}

.logout-btn {
    color: var(--f1-gray);
    font-size: 1.25rem;
    padding: 8px;
    border-radius: 50%;
    transition: 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

    .logout-btn:hover {
        color: var(--f1-red);
        background: rgba(225, 6, 0, 0.1);
    }

/* =========================================
   CARDS PRINCIPAIS
   ========================================= */
.f1-card {
    border: 1px solid var(--f1-border);
    border-radius: 20px;
    background: var(--f1-card);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.hero-card {
    overflow: hidden;
    position: relative;
}

    .hero-card::before {
        content: "";
        position: absolute;
        inset: 0 0 auto 0;
        height: 4px;
        background: linear-gradient(90deg, #b40000, var(--f1-red), #b40000);
    }

.hero-title,
.section-title {
    color: var(--f1-black);
    font-weight: 800;
    font-size: 1rem;
}

.section-subtitle {
    color: var(--f1-gray);
    font-size: 0.88rem;
}

.race-name {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--f1-black);
    margin-bottom: 0.25rem;
}

.race-meta {
    color: var(--f1-gray);
    font-size: 0.95rem;
}

.deadline-box {
    background: #15151e;
    border: 1px dashed var(--f1-border);
    border-radius: 14px;
    padding: 12px 14px;
}

.deadline-label {
    font-size: 0.8rem;
    color: var(--f1-gray);
}

.deadline-value {
    font-weight: 700;
    color: #fff;
    margin-top: 2px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 0.75rem;
    font-weight: 700;
}

.status-open {
    background: rgba(16, 185, 129, 0.15);
    color: var(--f1-success);
}

.btn-bet-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, var(--f1-red), #b40000);
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    box-shadow: 0 10px 20px rgba(225, 6, 0, 0.22);
    text-decoration: none; /* Garante que o link não tenha sublinhado */
}

    .btn-bet-primary:hover {
        color: #fff;
        filter: brightness(1.03);
    }

.summary-card .card-body {
    padding: 18px;
}

.summary-label {
    font-size: 0.82rem;
    color: var(--f1-gray);
    margin-bottom: 6px;
}

.summary-value {
    font-size: 1.45rem;
    font-weight: 900;
    color: var(--f1-black);
    line-height: 1.1;
}

.summary-subtext {
    color: var(--f1-gray);
    font-size: 0.88rem;
    margin-top: 5px;
}

/* =========================================
   AÇÕES RÁPIDAS
   ========================================= */
.quick-action-btn {
    width: 100%;
    min-height: 88px;
    border: 1px solid var(--f1-border);
    border-radius: 16px;
    background: #15151e;
    text-decoration: none;
    color: var(--f1-gray);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    transition: .2s ease;
}

    .quick-action-btn i {
        font-size: 1.15rem;
    }

    .quick-action-btn:hover {
        transform: translateY(-2px);
        background: #252532;
        color: #fff;
        border-color: var(--f1-red);
    }

.admin-action {
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

/* =========================================
   CLASSIFICAÇÃO E RANKING (MODO ESCURO)
   ========================================= */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ranking-row {
    border: 1px solid var(--f1-border);
    border-radius: 16px;
    padding: 14px;
    background: #15151e;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: white;
}

.rank-gold {
    background: linear-gradient(135deg, #2a2510, #1f1f2a);
    border-left: 4px solid #f0d469;
}

.rank-silver {
    background: linear-gradient(135deg, #1f2229, #1f1f2a);
    border-left: 4px solid #d7dee7;
}

.rank-bronze {
    background: linear-gradient(135deg, #2a1f1a, #1f1f2a);
    border-left: 4px solid #e1bb9e;
}

.ranking-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.ranking-position {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #2d2d3a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: white;
    flex-shrink: 0;
}

/* Cores específicas das posições do pódio */
.rank-gold .ranking-position {
    background: #f0d469;
    color: #15151e;
}

.rank-silver .ranking-position {
    background: #d7dee7;
    color: #15151e;
}

.rank-bronze .ranking-position {
    background: #e1bb9e;
    color: #15151e;
}

.ranking-name {
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.ranking-subtitle {
    color: var(--f1-gray);
    font-size: 0.82rem;
}

.ranking-right {
    text-align: right;
    flex-shrink: 0;
}

.ranking-delta {
    display: inline-block;
    font-size: 0.76rem;
    font-weight: 800;
    border-radius: 999px;
    padding: 4px 8px;
    margin-bottom: 4px;
}

    .ranking-delta.positive {
        background: rgba(16, 185, 129, 0.15);
        color: var(--f1-success);
    }

    .ranking-delta.negative {
        background: rgba(239, 68, 68, 0.15);
        color: var(--f1-danger);
    }

.ranking-points {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--f1-black);
    line-height: 1;
}

.ranking-points-label {
    font-size: 0.75rem;
    color: var(--f1-gray);
}

/* =========================================
   LISTAS DE INFORMAÇÕES E HISTÓRICO
   ========================================= */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--f1-border); /* Ajustado para dark mode */
    padding-bottom: 10px;
}

    .info-item:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

.info-label {
    color: var(--f1-gray);
    display: block;
}

.race-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--f1-border); /* Ajustado para dark mode */
}

    .race-history-item:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

.race-history-name {
    font-weight: 800;
    color: var(--f1-black);
}

.race-history-date,
.race-history-label {
    font-size: 0.82rem;
    color: var(--f1-gray);
}

.race-history-winner {
    font-weight: 700;
    color: var(--f1-black);
}

/* =========================================
   NAVEGAÇÃO MOBILE (BOTTOM BAR)
   ========================================= */
.bottom-mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 74px;
    background: rgba(21, 21, 30, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--f1-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1050;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-item {
    flex: 1;
    text-decoration: none;
    color: var(--f1-gray);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    gap: 4px;
    min-height: 74px;
}

    .bottom-nav-item i {
        font-size: 1rem;
    }

    .bottom-nav-item.active {
        color: var(--f1-red);
    }

/* =========================================
   PÁGINA DE LOGIN
   ========================================= */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(to bottom, rgba(225, 6, 0, 0.04), rgba(225, 6, 0, 0)), var(--f1-bg);
}

.login-card {
    border-radius: 24px;
}

.login-input {
    min-height: 48px;
    border-radius: 14px;
    border: 1px solid var(--f1-border);
    box-shadow: none;
    background: #15151e; /* Fundo do input adaptado pro dark */
    color: var(--f1-black);
}

    .login-input:focus {
        border-color: #f19996;
        box-shadow: 0 0 0 0.2rem rgba(225, 6, 0, 0.08);
    }

.login-help-text {
    color: var(--f1-gray);
    font-size: 0.9rem;
}

/* =========================================
   MEDIA QUERIES
   ========================================= */
@media (min-width: 768px) {
    .brand-title {
        font-size: 1.7rem;
    }

    .race-name {
        font-size: 2rem;
    }

    .ranking-name {
        max-width: 100%;
    }
}

@media (min-width: 992px) {
    .pb-mobile-nav {
        padding-bottom: 0;
    }
}
