/* --- GERAL E RESET --- */
:root {
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --secondary-color: #6c757d;
    --secondary-hover: #5a6268;
    --background-color: #f0f2f5;
    --card-background: #ffffff;
    --text-color: #333;
    --light-text-color: #666;
    --border-color: #dee2e6;
    --success-color: #28a745;
    --error-color: #dc3545;
    --loading-color: #ffc107;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    overflow-y: auto;
}

/* ========== SCROLLBAR INVISIVEL (GLOBAL) ========== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}
/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.container {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
}

/* --- CABEÇALHO E RODAPÉ --- */
header {
    background: linear-gradient(90deg, var(--primary-color), #0056b3);
    color: white;
    padding: 20px 40px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    font-weight: 700;
}

footer {
    text-align: center;
    padding: 15px;
    margin-top: 20px;
    font-size: 0.9em;
    color: var(--light-text-color);
}


/* --- LAYOUT DAS COLUNAS --- */
.input-column {
    flex: 1;
    min-width: 350px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.results-column {
    flex: 2;
    min-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* --- COMPONENTE CARD --- */
.card {
    background-color: var(--card-background);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 24px;
    transition: transform 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-5px);
}

.card h2 {
    font-weight: 500;
    margin-bottom: 16px;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.card p {
    color: var(--light-text-color);
    margin-bottom: 16px;
}

/* --- BOTÕES E FORMULÁRIOS --- */
button {
    cursor: pointer;
    border: none;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    font-size: 1em;
    font-weight: 500;
    transition: background-color 0.3s, transform 0.2s;
}

button:hover {
    transform: translateY(-2px);
}

button#startVoiceCmdBtn, button#submitTextBtn, button#filterBtn {
    background-color: var(--primary-color);
    color: white;
    width: 100%;
}

button#startVoiceCmdBtn:hover, button#submitTextBtn:hover, button#filterBtn:hover {
    background-color: var(--primary-hover);
}

button.secondary {
    background-color: var(--secondary-color);
    color: white;
}

button.secondary:hover {
    background-color: var(--secondary-hover);
}

textarea, input[type="date"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: 'Roboto', sans-serif;
    font-size: 1em;
    margin-bottom: 16px;
}

textarea:focus, input[type="date"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* --- ELEMENTOS ESPECÍFICOS --- */
#voiceStatusContainer {
    margin-top: 16px;
    padding: 10px;
    background-color: var(--background-color);
    border-radius: var(--border-radius);
    text-align: center;
    font-style: italic;
    color: var(--light-text-color);
}

.transcribed-text-container {
    margin-top: 16px;
    color: var(--text-color);
}
.transcribed-text-container em {
    color: var(--primary-color);
    font-weight: 500;
}

.message-container {
    padding: 15px;
    border-radius: var(--border-radius);
    text-align: center;
    display: none; /* Escondido por padrão */
    font-weight: 500;
}

.message-container.success {
    background-color: #d4edda;
    color: #155724;
    display: block;
}

.message-container.error {
    background-color: #f8d7da;
    color: #721c24;
    display: block;
}

.message-container.loading {
    background-color: #fff3cd;
    color: #856404;
    display: block;
}

.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}
.filter-controls .form-group {
    flex-grow: 1;
}
.filter-controls label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    font-size: 0.9em;
}
.filter-controls input {
    margin-bottom: 0;
}
.filter-controls button {
    flex-shrink: 0;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: linear-gradient(135deg, #4f46e5, #3b82f6);
  color: #fff;
  font-size: 14px;
}

.logo-title h1 {
  font-size: 20px;
  font-weight: bold;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.username {
  background: #2563eb;
  padding: 8px 12px;
  border-radius: 20px;
  font-weight: bold;
  color: #fff;
}

#logoutBtn {
  background: #ef4444;
  border: none;
  color: white;
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: 0.3s;
}

#logoutBtn:hover {
  background: #dc2626;
}
/* MODAL */
/* BOTÃO PARA ABRIR O CALENDÁRIO */
.btn-calendar {
  display: block;
  margin: 20px auto;
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 12px 18px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}
.btn-calendar:hover {
  background: #1d4ed8;
}

/* MODAL */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}
.modal-content {
  background: #fff;
  width: 90%;
  max-width: 600px;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  text-align: center;
  animation: slideUp 0.4s ease;
}
.close-btn {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 28px;
  cursor: pointer;
  color: #333;
}
.calendar-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 10px 0;
}
.btn-nav {
  background: #3b82f6;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}
.btn-nav:hover {
  background: #2563eb;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 15px;
}
.calendar-day {
  background: #f3f4f6;
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.badgeA, .badgeJ {
  font-size: 12px;
  color: #fff;
  padding: 2px 4px;
  border-radius: 4px;
  margin-top: 4px;
}
.badgeA { background: #2563eb; }  /* Azul almoço */
.badgeJ { background: #ef4444; }  /* Vermelho jantar */

/* ANIMAÇÕES */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { transform: translateY(50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}



/* --- TABELA DE RESULTADOS --- */
.table-wrapper {
    overflow-x: auto;
}

#reservasTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

#reservasTable th, #reservasTable td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

#reservasTable th {
    background-color: var(--background-color);
    font-weight: 500;
    color: var(--text-color);
}

#reservasTable tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

#reservasTable tbody tr:hover {
    background-color: #e9ecef;
}

/* --- RESPONSIVIDADE --- */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding: 16px;
    }
    
    header {
        padding: 15px;
    }

    .filter-controls {
        flex-direction: column;
        align-items: stretch;
    }
}