/* Variáveis de Tema */
:root {
    --primary-color: #003366;
    --secondary-color: #00509e;
    --accent-color: #ffcc00;
    --text-color: #333;
    --bg-color: #f4f4f9;
    --card-bg: #ffffff;
}

/* Reset Básico */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Header e Navegação */
header {
    background: var(--primary-color);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
}

nav {
    background: var(--secondary-color);
    padding: 0.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
nav img {
    width: auto;
    height: 1.5rem;
    display: inline-block;
    vertical-align: middle;
    margin-right: 0.4rem; /* Espaçamento entre o ícone e o texto */
}
nav a {
    color: white;
    text-decoration: none;
    display: inline-flex;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.2s;
}

nav a:hover, nav a.active {
    background: rgba(255, 255, 255, 0.2);
}

/* Responsividade do Menu no Celular */
@media (max-width: 768px) {
    nav img {
        height: 1rem; /* Reduz o tamanho dos ícones em telas menores */
    }
    .nav-container {
        gap: 8px; /* Reduz o espaço entre os links */
    }
    nav a {
        padding: 0.4rem 0.6rem;
        font-size: 0.9rem;
    }
    .user-info {
        flex-wrap: wrap; /* Permite que os botões caiam para a linha de baixo do avatar */
        justify-content: center;
    }
    .btn-perfil, .btn-logout {
        font-size: 0.8rem;
    }
}

/* Layout Principal */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .container {
        grid-template-columns: 2.5fr 1fr;
    }
}

/* Cards de Notícias */
.card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s;
    margin-bottom: 1.5rem;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.card .data {
    font-size: 0.85rem;
    color: #666;
    display: block;
    margin-bottom: 1rem;
}

.card .btn-ler {
    display: inline-block;
    margin-top: 1rem;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: bold;
}

.card .btn-ler:hover {
    text-decoration: underline;
}

/* Grid de Pilotos */
.grid-pilotos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}
.piloto-card {
    margin-bottom: 0;
}

.garagem-item {
    background: #f4f4f9;
    padding: 8px 10px;
    border-radius: 6px;
    margin-top: 8px;
    border-left: 3px solid var(--accent-color);
}
.garagem-carro {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}
.garagem-equipe {
    color: #666;
    display: block;
    margin-top: 2px;
}

/* --- Autenticação Discord --- */
.btn-discord {
    background-color: #5865F2; /* Cor Blurple oficial do Discord */
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}
.btn-discord:hover {
    background-color: #4752C4;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}
.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}
.user-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.user-roles {
    display: flex;
    gap: 4px;
    margin-top: 2px;
    flex-wrap: wrap;
}
.role-badge {
    background-color: var(--accent-color);
    color: #ffffff; /* Texto branco para dar contraste com as cores dos cargos */
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 12px;
    font-weight: bold;
}
.btn-perfil {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: bold;
}
.btn-perfil:hover {
    background: rgba(255, 255, 255, 0.3);
}
.btn-logout {
    background: transparent;
    border: 1px solid white;
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
}
.btn-logout:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Formulários */
.form-group {
    margin-bottom: 15px;
}
.form-control {
    width: 100%;
    max-width: 300px;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-top: 5px;
    font-size: 1rem;
}

/* Utilitários */
.bg-light { background: #eef2f5; }
.loading { text-align: center; padding: 2rem; color: #666; font-style: italic; }
.event-list { list-style: none; padding-top: 10px; }
.event-list li { padding: 8px 0; border-bottom: 1px solid #ddd; }

/* --- Slider Patrocinadores --- */
.sponsors-slider {
    position: relative;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #ddd;
}
.sponsor-logo {
    max-width: 90%;
    max-height: 90%;
    position: absolute;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    object-fit: contain;
}
.sponsor-logo.active {
    opacity: 1;
    z-index: 1;
}

footer {
    text-align: center;
    padding: 2rem;
    background: #222;
    color: white;
    margin-top: 3rem;
}

/*Patrocinadores Logos*/
#patrocinadores-container{
    width: 200px;
    height: 100px;
}

.sponsor-logo {
    max-width: 90%;
    max-height: 90%;
    position: absolute;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    object-fit: contain;
}
.sponsor-logo.active {
    opacity: 1;
}
