/* Custom CSS for ranking+ */

/* --primary-blue / --accent-orange / --spring-ease vêm de design-tokens.css (compartilhado) */
:root {
    --white: #fff;
    --gradient-blue: linear-gradient(135deg, #020122 0%, #23234a 100%);
    --gradient-orange: linear-gradient(135deg, #F4442E 0%, #fc9e4f 100%);
    --section-light: #f7f8fa;
}

/* Global Styles */
body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    scroll-behavior: smooth;
    background: var(--white);
    color: var(--primary-blue);
}

/* Destaque em cor sólida — usado nos títulos de seção no lugar de texto em gradiente */
.text-accent {
    color: var(--accent-orange);
}

/* ── Motion (Camada 1) — reveal ao rolar + entrada de listas dinâmicas ── */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .5s ease, transform .6s var(--spring-ease);
}
.reveal.reveal-visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-in-item {
    animation: fadeInUp .45s ease both;
}

@media (prefers-reduced-motion: reduce) {
    .reveal { transition: none; }
    .fade-in-item { animation: none; opacity: 1; transform: none; }
}

/* Gradient Buttons */
.btn-gradient {
    background: var(--accent-orange) !important;
    border: none;
    color: var(--white) !important;
    font-weight: 600;
    transition: background-color .3s ease, color .3s ease, transform .2s var(--spring-ease);
    box-shadow: 0 4px 15px rgba(244, 68, 46, 0.15);
}

.btn-gradient:hover {
    background: var(--primary-blue) !important;
    color: var(--accent-orange) !important;
}

.btn-gradient:active {
    transform: scale(0.96);
}

/* Custom Background Colors */
/* Hero Section */
.hero-section {
    background: var(--gradient-blue);
    color: var(--white);
    position: relative;
}

/* Padrão geométrico autoral (grade de pontos + linhas em diagonal, tema "conquista")
   no lugar de foto de banco de imagens — leve, sem depender de asset externo.
   position:absolute+inset:0 é necessário: a div não tem conteúdo próprio, então
   sem isso ela colapsa pra 0x0 e o fundo (seja imagem ou padrão) nunca aparece. */
.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 2px 2px, rgba(244,68,46,0.35) 1.5px, transparent 1.5px),
        linear-gradient(135deg, transparent 48%, rgba(244,68,46,0.12) 49%, rgba(244,68,46,0.12) 51%, transparent 52%);
    background-size: 28px 28px, 140px 140px;
    opacity: 0.5;
}

/* Animations */
.animate-fade-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.8s ease forwards;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Navbar */
.navbar {
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

/* Modal Styles */
.modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.form-control {
    border-radius: 10px;
    border: 1px solid #e9ecef;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* ── RESPONSIVO ─────────────────────────────────────────────── */

/* Compensa a navbar fixed-top em todos os tamanhos */
.hero-section {
    padding-top: 80px; /* altura mínima da navbar */
}

/* Notebook / telas intermediárias (768px – 1199px) */
@media (max-width: 1199px) {
    .display-1 {
        font-size: clamp(2.2rem, 5vw, 4.5rem);
    }
    .hero-section {
        padding-top: 76px;
    }
    /* Navbar: reduz gaps e fontes para caber */
    .navbar .nav-link {
        font-size: 0.88rem;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    .navbar .btn {
        font-size: 0.82rem;
        padding: 5px 12px;
    }
    .navbar .logo {
        height: 38px !important;
    }
}

/* Tablet / mobile */
@media (max-width: 991px) {
    .hero-section {
        padding-top: 70px;
    }
    /* Menu colapsado — sem sobreposição */
    .navbar-collapse {
        background: #fff;
        border-top: 1px solid #eee;
        padding: 12px 16px;
        box-shadow: 0 4px 12px rgba(0,0,0,.08);
    }
    #authButtons, #userInfo {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 8px;
    }
}

@media (max-width: 768px) {
    .display-1 {
        font-size: 2rem;
    }
    .hero-section {
        padding-top: 68px;
    }
}

@media (max-width: 576px) {
    .display-1 {
        font-size: 1.7rem;
    }
    .hero-section h1 br {
        display: none; /* "Reconheça<br>os Melhores" vira linha única */
    }
}

.text-white {
    color: #fff !important;
}
footer .text-muted {
    color: #f2f3ae !important; /* Vanilla para textos do rodapé */
}

.navbar, .navbar-light {
    background: var(--white) !important;
    border-bottom: 2px solid var(--primary-blue);
}

.navbar-brand, .nav-link {
    color: var(--primary-blue) !important;
}

.nav-link.active, .nav-link:hover {
    color: var(--accent-orange) !important;
}

footer {
    background: var(--primary-blue) !important;
    color: var(--white) !important;
}
footer .text-muted, footer a {
    color: #f2f3ae !important;
}

/* ── HERO HEIGHT ────────────────────────────────────────── */
.hero-section {
    min-height: 100vh;
}

/* ── STATS BAR ──────────────────────────────────────────── */
.stats-bar {
    display: inline-flex;
    align-items: center;
    gap: 0;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 50px;
    padding: 12px 28px;
    backdrop-filter: blur(8px);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 20px;
    color: #fff;
    min-width: 90px;
}

.stat-item i {
    font-size: 1.1rem;
    opacity: .7;
    margin-bottom: 2px;
}

.stat-item span {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.stat-item small {
    font-size: 0.68rem;
    opacity: .65;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.stat-divider {
    width: 1px;
    height: 36px;
    background: rgba(255,255,255,0.2);
    flex-shrink: 0;
}

@media (max-width: 576px) {
    .stats-bar {
        flex-wrap: wrap;
        border-radius: 20px;
        padding: 12px 16px;
        gap: 8px;
    }
    .stat-divider { display: none; }
    .stat-item { min-width: 70px; padding: 4px 10px; }
}

/* ── SECTION LIGHT ──────────────────────────────────────── */
.section-light {
    background: var(--section-light);
}

/* ── SECTION HEADER ─────────────────────────────────────── */
.section-header h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}
.section-header p {
    font-size: .95rem;
    max-width: 520px;
    margin: 0 auto;
}

/* ── FEATURE CARDS ──────────────────────────────────────── */
.feature-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.75rem 1.25rem;
    border: 1px solid rgba(0,0,0,.06);
    transition: box-shadow .3s ease, transform .35s var(--spring-ease);
}

.feature-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    transform: translateY(-4px);
}

.feature-card:hover .feature-icon {
    transform: scale(1.08) rotate(-4deg);
}

.feature-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--accent-orange);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin: 0 auto;
    transition: transform .35s var(--spring-ease);
}

.feature-icon.navy {
    background: var(--primary-blue);
}

/* ── RANKING LIST ───────────────────────────────────────── */
.ranking-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid rgba(0,0,0,.06);
    margin-bottom: 10px;
    transition: box-shadow .2s;
}

.ranking-row:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
}

.rank-pos {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .9rem;
    flex-shrink: 0;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.rank-pos.p1 { background: linear-gradient(135deg,#ffc107,#ff8f00); }
.rank-pos.p2 { background: linear-gradient(135deg,#9e9e9e,#616161); }
.rank-pos.p3 { background: linear-gradient(135deg,#fd7e14,#dc2626); }
.rank-pos.pd { background: var(--primary-blue); }

.rank-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.rank-info { flex: 1; min-width: 0; }
.rank-info .nome { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-info .curso { font-size: .75rem; color: #6c757d; }

.rank-score {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--accent-orange);
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}
.rank-score small { font-size: .65rem; color: #999; display: block; text-align: right; font-weight: 400; }

/* ── FOOTER ─────────────────────────────────────────────── */
.site-footer {
    background: var(--primary-blue);
    color: rgba(255,255,255,.7);
    padding: 2.5rem 0 1.5rem;
}

.footer-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: space-between;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.footer-brand p { color: rgba(255,255,255,.5); }

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
}

.footer-links a {
    color: rgba(255,255,255,.6);
    text-decoration: none;
    font-size: .85rem;
    transition: color .2s;
}

.footer-links a:hover { color: #fff; }

.footer-social {
    display: flex;
    gap: 14px;
}

.footer-social a {
    color: rgba(255,255,255,.6);
    font-size: 1.2rem;
    transition: color .2s;
    text-decoration: none;
}

.footer-social a:hover { color: #fff; }

.footer-copy {
    text-align: center;
    font-size: .78rem;
    color: rgba(255,255,255,.35);
    padding-top: 1rem;
}

@media (max-width: 768px) {
    .footer-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
}
