/* Arquivo: src/style.css */

/* Reset básico e fontes */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
    color: #333;
    line-height: 1.6;
}

/* Container principal para centralizar conteúdo */
main {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 1rem;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    border-radius: 5px;
}

header {
    background-color: #333;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

header h1 {
    margin: 0;
    font-size: 1.5rem;
}

nav a {
    color: white;
    margin-left: 1rem;
    text-decoration: none;
    transition: color 0.3s;
}

nav a:hover {
    color: #4CAF50;
}

.menu-toggle {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    background-color: #444;
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    z-index: 1000;
}

#sidebar {
    width: 250px;
    background-color: #444;
    color: white;
    padding-top: 20px;
    height: 100vh;
    position: fixed;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    left: 0;
    top: 0;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 999;
}

#sidebar .user-info {
    padding: 0 20px 20px 20px;
    border-bottom: 1px solid #555;
    font-size: 14px;
}

#sidebar #current-datetime {
    display: block;
    margin-top: 6px;
    color: #ddd;
    font-weight: 600;
}

#sidebar .menu-item {
    border-bottom: 1px solid #555;
}

#sidebar .menu-item a {
    display: block;
    padding: 10px 20px;
    color: white;
    text-decoration: none;
    transition: background-color 0.3s;
}

#sidebar .menu-item a:hover {
    background-color: #666;
}

#install-banner {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 1200;
    background: #ffffff;
    color: #111;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(0,0,0,0.12);
    padding: 12px 12px;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 360px;
    width: calc(100% - 32px);
}

#install-banner button {
    border: 0;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 0.95rem;
}

#install-btn {
    background: #4CAF50;
    color: #fff;
}

#install-close {
    background: #eeeeee;
    color: #333;
    width: 40px;
}

@media (min-width: 769px) {
    #install-banner {
        width: 360px;
    }
}

body.with-sidebar main {
    margin-left: 250px;
    width: calc(100% - 250px);
    max-width: none;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    #sidebar {
        transform: translateX(-100%);
        height: 100vh;
        position: fixed;
    }

    #sidebar.is-active {
        transform: translateX(0);
    }

    .menu-toggle {
        display: block;
    }

    body.with-sidebar main {
        margin-left: 0;
        width: 100%;
    }
}

.nav-inline { display: none !important; }


/* Formulários e Inputs */
input, 
input[type="number"], 
input[type="email"], 
input[type="password"],
input[type="date"],
input[type="time"],
select {
    display: block;
    width: 100%;
    padding: 10px;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Garante que padding não aumente a largura */
}

button, .btn {
    background-color: #4CAF50; /* Cor principal de ação */
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 0.5rem;
}

button:hover, .btn:hover {
    background-color: #45a049;
}

/* Mensagens de Status */
.status-msg, .alert-sucesso {
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 1rem;
    border: 1px solid #4CAF50;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-erro {
    background-color: #ffe0e0;
    color: #f44336;
    padding: 1rem;
    border: 1px solid #f44336;
    border-radius: 4px;
    margin-bottom: 1rem;
}


/* Tabelas */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background-color: #fff;
}

th, td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

th {
    background-color: #f2f2f2;
}

/* --- ESTILOS DO CALENDÁRIO DE AGENDAMENTO (NOVOS, mas minimizados) --- */

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr); 
    gap: 5px;
    margin-top: 10px;
}

.calendar-header {
    background-color: #f2f2f2;
    padding: 5px;
    text-align: center;
    font-weight: bold;
}

.calendar-day {
    padding: 10px 5px;
    border: 1px solid #ccc;
    text-align: center;
    border-radius: 4px;
    min-height: 60px;
}

.calendar-day strong {
    display: block;
    font-size: 1.2rem;
}

.calendar-day.available {
    background-color: #e0ffe0; 
    border-color: #4CAF50; 
    color: #4CAF50;
    cursor: pointer;
    transition: background-color 0.3s;
}

.calendar-day.available:hover {
    background-color: #c8ffc8;
}

.calendar-day.unavailable {
    background-color: #ffe0e0; 
    border-color: #f44336; 
    color: #f44336;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Estilo para a lista de horários específicos */
#horarios_disponiveis_container {
    margin-top: 1.5rem;
    border-top: 1px solid #ddd;
    padding-top: 1rem;
}

/* AQUI ESTÁ O AJUSTE CRÍTICO: Definindo o estilo do botão de horário corretamente */
.horario-btn {
    /* Usando inline-block para que se alinhem horizontalmente e sejam clicáveis */
    display: inline-block; 
    background-color: #007BFF; /* Azul para horários disponíveis */
    color: white;
    padding: 8px 12px;
    margin: 5px;
    border-radius: 4px;
    cursor: pointer;
    border: none; /* Garante que não haja bordas estranhas */
    /* Remove a regra genérica 'margin-top: 0.5rem' que estava em 'button, .btn' */
    margin-top: 0px; 
}

.horario-btn:hover {
    background-color: #0056b3;
}

/* NOVO ESTILO: Para horários que já passaram ou estão lotados */
.horario-btn-disabled {
    background-color: #cccccc; /* Cinza para desabilitado */
    color: #666666;
    cursor: not-allowed;
    opacity: 0.6;
}

/* --- MOBILE AJUSTES --- */
@media (max-width: 480px) {
    header { padding: 0.75rem; }
    header h1 { font-size: 1.25rem; }
    nav a { margin-left: 0.5rem; font-size: 0.95rem; }
    main { margin: 1rem auto; padding: 0.75rem; }
    input, select, button, .btn { font-size: 1.05rem; padding: 12px; }
    table { display: block; overflow-x: auto; }
    table th, table td { white-space: nowrap; padding: 10px; }
}
.calendar-day.selected-day {
    border: 2px solid #007BFF; /* Adiciona uma borda azul ao dia selecionado */
    background-color: #cce5ff;
}

/* --- TEMAS --- */
html.theme-dark body { background-color:#121212; color:#e0e0e0; }
html.theme-dark header { background-color:#1f1f1f; color:#e0e0e0; }
html.theme-dark nav a { color:#e0e0e0; }
html.theme-dark nav a:hover { color:#90CAF9; }
html.theme-dark main { background-color:#1f1f1f; box-shadow: 0 0 10px rgba(0,0,0,0.5); }
html.theme-dark table { background-color:#1f1f1f; }
html.theme-dark th { background-color:#2a2a2a; }
html.theme-dark td, html.theme-dark th { border-color:#333; }
html.theme-dark .btn, html.theme-dark button { background-color:#388E3C; color:#fff; }
html.theme-dark .btn:hover, html.theme-dark button:hover { background-color:#2E7D32; }
html.theme-dark .sidebar { background:#1f1f1f; }
html.theme-dark .sidebar a { color:#e0e0e0; }
