/* style.css - VERSÃO FINAL UNIFICADA (Login + Painel + Partida) */

:root {
    --primary: #2e7d32;   /* Verde Gramado */
    --secondary: #1b5e20; /* Verde Escuro */
    --accent: #ffd600;    /* Amarelo */
    --danger: #d32f2f;    /* Vermelho */
    --dark: #121212;
    --light: #ffffff;
    --sidebar-width: 260px;
    --card-radius: 20px;
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Poppins', sans-serif; 
}

/* --- FUNDO E VÍDEO (FIXO) --- */
body {
    background-color: transparent !important; /* Importante para o vídeo aparecer */
    color: #333; /* Cor padrão do texto */
    line-height: 1.6;
    min-height: 100vh;
}

#video-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    object-fit: cover;
    z-index: -100;
}

.video-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(255, 255, 255, 0.1); /* Leve clareamento */
    backdrop-filter: blur(3px);
    z-index: -50;
}

/* ==========================================================================
   TELA DE LOGIN (RECUPERADA)
   ========================================================================== */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    background: rgba(255, 255, 255, 0.95);
    width: 1000px;
    max-width: 100%;
    min-height: 600px;
    border-radius: 25px;
    display: flex;
    box-shadow: 0 15px 50px rgba(0,0,0,0.2);
    overflow: hidden;
}

.left-side {
    flex: 1;
    background-color: #f7f7f7;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}
.left-side img { max-width: 100%; height: auto; }

.right-side {
    flex: 1;
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.header-text h1 { color: var(--primary); font-size: 2.2rem; margin-bottom: 25px; }
.header-text h3 { color: #666; font-size: 1.1rem; font-weight: 500; }

/* Inputs do Login */
.input-group { margin-bottom: 15px; }
.input-wrapper { position: relative; display: flex; align-items: center; }
.input-wrapper i { position: absolute; left: 15px; color: var(--primary); z-index: 10; }
.input-wrapper input, .input-wrapper select {
    width: 100%;
    padding: 12px 15px 12px 45px !important; /* Espaço para ícone */
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
    outline: none;
    transition: 0.3s;
}
.input-wrapper input:focus { border-color: var(--primary); background: #fff; }

.register-link { text-align: center; margin-top: 20px; font-size: 0.9rem; }
.register-link a { color: var(--primary); font-weight: 600; text-decoration: none; }

/* ==========================================================================
   PAINEL (SIDEBAR E CONTEÚDO)
   ========================================================================== */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100%;
    z-index: 100;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.sidebar .logo {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 40px;
    display: flex; align-items: center; gap: 10px;
}

.nav-menu { list-style: none; flex: 1; }
.nav-item { margin-bottom: 5px; }

.nav-link {
    display: flex; align-items: center; gap: 15px;
    padding: 12px 15px; color: #555; text-decoration: none;
    font-weight: 500; border-radius: 12px; transition: 0.3s;
}
.nav-link:hover, .nav-link.active { background-color: #e8f5e9; color: var(--primary); font-weight: 600; }

.main-content {
    margin-left: var(--sidebar-width);
    padding: 40px;
    min-height: 100vh;
}

.dashboard-header {
    background: rgba(255, 255, 255, 0.9);
    padding: 15px 30px; border-radius: 15px;
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 30px; box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

/* ==========================================================================
   CARDS E FORMULÁRIOS
   ========================================================================== */
.card {
    background: #ffffff;
    border-radius: var(--card-radius);
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    margin-bottom: 25px;
    width: 100%;
}

.card-title {
    font-size: 1.2rem; font-weight: 700; color: var(--primary);
    margin-bottom: 20px; display: block; border-bottom: 1px solid #eee; padding-bottom: 10px;
}

/* Formulário de Perfil e Admin */
form { display: flex; flex-direction: column; gap: 15px; }
form label { font-weight: 600; color: #444; margin-bottom: 5px; display: block; }
form input[type="text"], form input[type="email"], form input[type="password"], form input[type="datetime-local"], form select {
    width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 8px;
    font-size: 1rem; background: #f9f9f9; color: #333;
}

/* ==========================================================================
   ESTILOS DA PARTIDA AO VIVO
   ========================================================================== */
.admin-card {
    background: rgba(30, 41, 59, 0.9) !important; /* Fundo Escuro */
    color: #fff !important;
    border-radius: 20px; padding: 20px; margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
}

.live-indicator {
    background: rgba(255,0,0,0.2); color: #ff4444; padding: 5px 15px;
    border-radius: 20px; display: inline-flex; align-items: center; gap: 8px;
    font-weight: bold; font-size: 0.8rem; margin-bottom: 10px;
}
.live-dot { width: 8px; height: 8px; background: red; border-radius: 50%; }

.timer-display {
    font-size: 3.5rem; font-weight: 800; color: var(--accent);
    text-align: center; font-family: monospace; margin: 10px 0;
}

.scoreboard {
    display: flex; justify-content: center; align-items: center; gap: 30px;
    background: rgba(0,0,0,0.2); padding: 20px; border-radius: 20px; margin-top: 20px;
}
.score-number { font-size: 4rem; font-weight: 800; line-height: 1; }
.score-divider { font-size: 2rem; color: #aaa; }

.match-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px; margin-top: 20px;
}

.player-row {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(255,255,255,0.05); padding: 10px 15px;
    border-radius: 10px; margin-bottom: 8px;
}

.stat-btn {
    text-decoration: none; color: white; padding: 5px 10px;
    border-radius: 8px; font-size: 0.85rem; display: flex;
    flex-direction: column; align-items: center; min-width: 50px; margin-right: 10px;
}
.player-name { flex: 1; text-align: right; font-weight: 500; }

/* Botões Globais */
.btn-login {
    background: var(--primary); color: white; border: none; padding: 12px 20px;
    border-radius: 8px; font-weight: 600; cursor: pointer; text-align: center;
    width: 100%; margin-top: 10px; transition: 0.2s;
}
.btn-login:hover { background: var(--secondary); }

.btn-admin-badge {
    padding: 5px 12px; border-radius: 20px; font-size: 0.8rem;
    text-decoration: none; color: white; background: var(--primary);
    display: inline-block;
}

/* Tabelas */
.ranking-table { width: 100%; border-collapse: collapse; }
.ranking-table th { text-align: left; padding: 12px; color: #666; border-bottom: 2px solid #eee; }
.ranking-table td { padding: 15px 12px; border-bottom: 1px solid #f0f0f0; color: #333; }

/* Utilitários */
.hidden { display: none !important; }
.alert-box {
    background-color: #fff5f5; color: #c53030; padding: 12px 15px;
    border-radius: 10px; border-left: 5px solid #c53030; margin-bottom: 20px;
}

.mobile-header {
    display: none; /* Hidden by default */
}

.sidebar-overlay {
    display: none;
}

/* Responsividade */
@media (max-width: 768px) {
    .left-side { display: none; }
    .right-side { padding: 30px; }
    .login-container { min-height: auto; width: 95%; margin: 0 auto; }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 1001; /* Must be on top of overlay */
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        display: none;
    }

    .sidebar-overlay.open {
        display: block;
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
        padding-top: 80px; /* Space for mobile header */
    }

    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 20px;
        height: 60px;
        background: rgba(255, 255, 255, 0.9);
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
    }

    .menu-toggle {
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--primary);
        cursor: pointer;
    }

    .mobile-header .logo {
        font-size: 1.2rem;
        font-weight: 700;
        color: var(--primary);
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .dashboard-header {
        margin-top: 0;
    }

    .match-grid { grid-template-columns: 1fr; }
    .timer-display { font-size: 2.5rem; }
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.view { animation: fadeIn 0.4s ease-out; }

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

#alert-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}
