/* admin/css/admin_style.css */

/* VARIÁVEIS DE COR PADRONIZADAS COM O SITE PÚBLICO */
:root {
    /* Cores Gakudo Aloha (PADRONIZADAS) */
    --ocean-blue: #0077b6; /* Azul Escuro do Mar - Principal */
    --coral-accent: #ff6b6b; /* Coral - Secundário/Ação */
    
    /* CORES DO PAINEL ADMIN (Usam as cores acima) */
    --primary-color: var(--ocean-blue); 
    --secondary-color: var(--coral-accent); 
    --bg-light: #f0f8ff; /* Fundo muito claro (Azul Bebê) */
    --bg-white: #ffffff;
    --text-dark: #333333;
    --text-light: #666666;
    --success-color: #4caf50;
    --error-color: #f44336;
    --shadow-light: 0 4px 10px rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* --- ADMIN HEADER / MENU --- */

.admin-header {
    background-color: var(--primary-color);
    color: var(--bg-white);
    padding: 15px 0;
    box-shadow: var(--shadow-light);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.logo a {
    color: var(--bg-white);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 600;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

.main-nav a {
    color: var(--bg-white);
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.main-nav a:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

/* Container para ações (Idiomas e Logout) */
.header-actions {
    display: flex; 
    align-items: center;
    gap: 15px; 
}

/* Botão de Logout */
.logout-btn a {
    color: var(--bg-white);
    background-color: var(--secondary-color);
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s;
    display: inline-block;
}

.logout-btn a:hover {
    background-color: #e65c5c;
}

/* Seletor de idiomas no cabeçalho */
.language-switcher-admin a {
    color: var(--bg-white);
    text-decoration: none;
    font-size: 1.1rem;
    padding: 5px;
    transition: opacity 0.3s;
}
.language-switcher-admin a:hover {
    opacity: 0.8;
}

/* --- ADMIN INDEX SECTIONS (Cards) --- */

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.admin-section {
    background-color: var(--bg-white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: var(--shadow-light);
    transition: transform 0.3s;
}

.admin-section:hover {
    transform: translateY(-5px);
}

.admin-section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.6rem;
    border-bottom: 2px solid var(--bg-light);
    padding-bottom: 10px;
}

.admin-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.action-btn {
    display: block;
    padding: 12px 20px;
    text-align: center;
    color: var(--bg-white);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color 0.3s;
}

.action-add {
    background-color: var(--success-color);
}
.action-view {
    background-color: var(--primary-color);
}

.action-add:hover { background-color: #42a246; }
.action-view:hover { background-color: #006399; }

/* --- FORMULÁRIOS GERAIS (ESTILO MODERNO) --- */

form {
    display: flex;
    flex-direction: column;
    gap: 10px; 
    padding: 10px 0; 
}

label {
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 5px;
    font-size: 0.95rem;
}

input[type="text"],
input[type="password"],
input[type="file"],
textarea {
    width: 100%;
    padding: 12px; 
    border: 1px solid #d0d0d0;
    border-radius: 8px; 
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    background-color: #fafafa; 
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.25);
    background-color: var(--bg-white);
}

textarea {
    resize: vertical;
    min-height: 150px; 
}

/* **CORREÇÃO/MELHORIA:** BOTÃO MAIOR E MAIS ALTO PARA "ADICIONAR NOVO EVENTO" (Mobile e Desktop) */
.admin-submit-btn,
button[type="submit"] {
    background-color: var(--secondary-color);
    color: var(--bg-white);
    /* AUMENTO DA ALTURA e TAMANHO */
    padding: 18px 20px; 
    font-size: 1.2rem; 
    
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    margin-top: 25px;
    transition: background-color 0.3s;
    width: 100%; 
}

.admin-submit-btn:hover,
button[type="submit"]:hover {
    background-color: #e65c5c;
}

/* --- MENSAGENS --- */

.message {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-weight: 600;
}

.message.success {
    background-color: #e8f5e9;
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.message.error {
    background-color: #ffebee;
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

/* --- TABELAS (Gerenciar Páginas) --- */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: var(--bg-white);
    box-shadow: var(--shadow-light);
    border-radius: 8px;
    overflow: hidden; 
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: var(--primary-color);
    color: var(--bg-white);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

.btn-deletar {
    color: var(--error-color);
    text-decoration: none;
    padding: 5px 10px;
    border: 1px solid var(--error-color);
    border-radius: 4px;
    transition: background-color 0.3s, color 0.3s;
    font-size: 0.9rem;
    display: inline-block;
}

.btn-deletar:hover {
    background-color: var(--error-color);
    color: var(--bg-white);
}

/* --- RESPONSIVIDADE (MOBILE FIRST) --- */

@media (max-width: 768px) {
    /* 1. LAYOUT DO HEADER: Logo em cima, Menu/Ações alinhados à direita */
    .header-content {
        flex-direction: column;
        align-items: flex-start; /* Logo no canto esquerdo */
        padding: 15px 5%; 
        width: 100%; 
    }

    .logo {
        margin-bottom: 10px;
        width: 100%;
    }
    
    /* 2. MUDANÇA: Alinha o Menu de Navegação à direita */
    .main-nav {
        width: 100%;
        margin-bottom: 5px;
        display: flex; 
        justify-content: flex-end; /* ALINHA O MENU NA EXTREMA DIREITA */
    }

    /* Ajusta os links do menu para ficarem alinhados à direita */
    .main-nav ul {
        flex-direction: column;
        gap: 5px; 
        align-items: flex-end; /* Alinha os links da lista à direita */
    }

    /* 3. MUDANÇA: Alinha o Contêiner de Ações (Idiomas + Logout) à direita */
    .header-actions {
        width: 100%;
        justify-content: flex-end; /* MOVE O CONTEÚDO PARA O CANTO DIREITO */
        margin-bottom: 5px;
        gap: 10px; 
    }
    
    /* 4. MUDANÇA: CORREÇÃO DO BOTÃO LOGOUT JAPONÊS */
    .logout-btn a {
        display: inline-block;
        /* Define a largura mínima para acomodar 'sair' ou 'ログアウト' (Logout) sem quebra */
        min-width: 90px; 
        text-align: center; 
        padding: 8px 10px;
        width: auto; 
    }
    
    /* Tabelas responsivas (mantido) */
    table, thead, tbody, th, td, tr {
        display: block;
    }
    
    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    tr { border: 1px solid #ccc; margin-bottom: 15px; }
    
    td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%;
        text-align: right;
    }
    
    td:before {
        position: absolute;
        top: 6px;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: 600;
        color: var(--primary-color);
    }
    
    /* Mapeamento dos cabeçalhos nas células */
    td:nth-of-type(1):before { content: "ID"; }
    td:nth-of-type(2):before { content: "Título"; }
    td:nth-of-type(3):before { content: "Data"; }
    td:nth-of-type(4):before { content: "Ações"; }
}

/* --- ESTILOS DE LOGIN --- */

.login-body {
    background-color: var(--primary-color); 
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.login-container {
    background-color: var(--bg-white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--shadow-light); 
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.login-container h2 {
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 1.8rem;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    margin-bottom: 20px;
    padding: 12px; 
    border: 1px solid #d0d0d0;
    border-radius: 8px; 
    width: 100%;
    font-size: 1rem;
}

.login-form button[type="submit"] {
    background-color: var(--secondary-color); 
    color: var(--bg-white);
    padding: 15px 20px; 
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
    width: 100%;
    transition: background-color 0.3s;
}

.login-form button[type="submit"]:hover {
    background-color: #e65c5c; 
}

.error-message {
    color: var(--error-color);
    margin-bottom: 15px;
    font-weight: 600;
}

.login-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.login-actions a {
    color: var(--primary-color); 
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.login-actions a:hover {
    color: var(--secondary-color);
}

/* Estilos para as mensagens de status */
.admin-alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-weight: bold;
    border: 1px solid transparent;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

/* Estilos gerais para o botão de salvar/voltar em páginas de edição */
.form-actions {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    margin-top: 20px;
    align-items: center; /* Mantém o alinhamento no centro vertical */
}

/* Aplica os estilos do .admin-submit-btn e neutraliza conflitos de altura */
.form-actions .admin-submit-btn,
.form-actions .btn-voltar {
    /* Neutraliza a altura fixa e font-size conflitantes: */
    height: auto !important; /* Deixa o padding definir a altura */
    font-size: 1.2rem; /* Usa o tamanho de fonte grande do botão de submit */
    padding: 18px 20px; /* CRÍTICO: Usa o mesmo padding do botão de submit */

    /* Garante que ambos sejam flexíveis, ocupando metade do espaço */
    flex-grow: 1;
    max-width: 50%;
    
    /* Demais propriedades de padronização */
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-radius: 8px; /* Usa a mesma borda do botão de submit */
    box-sizing: border-box;
    border: none;
    cursor: pointer;
    line-height: 1.2; /* Centraliza o texto interno */
}

/* Estilo específico para o botão Voltar (Link) */
.btn-voltar {
    text-decoration: none;
    background-color: #6c757d; /* Cinza escuro */
    color: white;
    /* Sobrescreve a margem superior indesejada que a tag <a> pode herdar */
    margin-top: 0 !important; 
}

/* Opcional: Ajusta o padding para o botão submit padrão para não ter margin-top grande */
.admin-submit-btn,
button[type="submit"] {
    margin-top: 0 !important;
}

/* --- RESPONSIVIDADE (MOBILE FIRST) --- */
@media (max-width: 768px) {
    /* ... (outras regras de mobile) ... */

    /* CORREÇÃO DO EMPILHAMENTO DOS BOTÕES DE FORMULÁRIO */
    .form-actions {
        flex-direction: column; /* Força os botões a ficarem um em cima do outro */
        gap: 15px; 
    }

    .form-actions .admin-submit-btn,
    .form-actions .btn-voltar {
        width: 100%; /* Ocupa a largura total */
        max-width: none;
        /* Volta o padding para o mobile se necessário, mas 18px deve ser ok */
    }
    .date-inputs {
    display: flex;
    align-items: center;
    gap: 5px;
}
.date-inputs span {
    font-size: 1.2rem;
}
.date-inputs {
    display: flex;
    align-items: center;
    gap: 5px;
}
.date-inputs span {
    font-size: 1.2rem;
    color: #6c757d;
}
.date-inputs input {
    text-align: center;
}
.agenda-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}
.agenda-do-dia {
    margin-top: 2.5rem;
}
.lista-chegada {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    max-height: 300px;
    overflow-y: auto;
}
.lista-chegada ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.lista-chegada li {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e9ecef;
}
.lista-chegada li:last-child {
    border-bottom: none;
}
.lista-chegada .horario {
    font-weight: bold;
    color: #005A9C;
    font-size: 1.1rem;
    width: 80px;
}
}