/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Variáveis para cores e tamanhos */
:root {
  --primary-dark: #1a3c5a;
  --primary-light: #2e6d97;
  --text-dark: #2c3e50;
  --shadow-light: rgba(0, 0, 0, 0.08);
  --shadow-dark: rgba(0, 0, 0, 0.15);
  --cancel-red: #e53e3e;
  --cancel-dark: #c53030;
  --reagendar-yellow: #f6bf26;
  --reagendar-dark: #d69e2e;
  --status-green: #2ecc71;
  --status-red: #e74c3c;
  --status-yellow: #f1c40f;
  --status-orange: #e67e22;
  --doctor-highlight: #007bff;
  --transition: all 0.3s ease;
}

/* Corpo */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text-dark);
  line-height: 1.5;
}

/* Container principal */
.agenda-container {
  width: 100%;
  height: 100%;
  padding: 1.5rem;
  background: transparent;
  display: flex;
  flex-direction: column;
}

/* Título */
.agenda-container h2 {
  text-align: center;
  font-size: 1.5rem;
  color: var(--primary-dark);
  font-weight: 600;
  margin-bottom: 1rem;
}

/* Exibição da data */
#currentDate {
  display: block;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  color: #ffffff;
  background: var(--primary-dark);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  margin: 0 auto 1.5rem;
  animation: none;
}

/* Animação de pulsar para a data */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* Abas */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  justify-content: center;
}

.tab-button {
  padding: 0.75rem 1.25rem; /* Aumentado para mais presença */
  background: #e2e8f0; /* Cinza claro mais visível */
  border: none;
  border-radius: 8px; /* Bordas mais suaves */
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600; /* Peso maior para parecer botão */
  color: var(--text-dark);
  box-shadow: 0 2px 4px var(--shadow-light); /* Sombra leve por padrão */
  transition: var(--transition);
}

.tab-button:hover {
  background: #cbd5e1; /* Cinza mais escuro no hover */
  transform: translateY(-2px); /* Elevação sutil */
  box-shadow: 0 4px 8px var(--shadow-dark); /* Sombra mais forte */
}

.tab-button.active {
  background: var(--primary-light);
  color: #ffffff;
  box-shadow: 0 4px 8px var(--shadow-dark); /* Mantém sombra no ativo */
  transform: translateY(0); /* Sem elevação no ativo */
}

/* Lista de agendamentos */
.agenda-list {
  list-style: none;
  padding: 0;
  display: none;
  flex-grow: 1;
  overflow-y: auto;
}

.agenda-list.active {
  display: block;
}

.agenda-item {
  background: #ffffff;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: 6px;
  border-left: 3px solid var(--primary-light);
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 1px 3px var(--shadow-light);
  animation: fadeIn 0.5s ease-out; /* Animação de entrada */
}

/* Animação de fade-in para itens da agenda */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Informações do agendamento */
.appointment-info {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-dark);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Linhas de informação */
.appointment-info .info-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Rótulos */
.appointment-info .label {
  font-weight: 600;
  color: var(--primary-dark);
  white-space: nowrap;
}

/* Valores */
.appointment-info .value {
  font-weight: 400;
  color: var(--text-dark);
}

/* Dr(a) */
.appointment-info .doctor-label {
  font-size: 1rem;
  font-weight: 700;
}

.appointment-info .doctor-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-dark); /* Invertido: agora cinza escuro (#2c3e50) */
}

/* Tipo de consulta */
.appointment-info .type-label {
  font-weight: 600;
}

.appointment-info .type-value {
  color: #2980b9; /* Mesma cor do time-value para consistência */
  font-size: 0.875rem;
  font-weight: 500;
}

/* Hora */
.appointment-info .time-label {
  font-weight: 600;
}

.appointment-info .time-value {
  color: #2980b9;
  font-size: 1rem;
  font-weight: 500;
}

/* Descrição */
.appointment-info .description-label {
  font-weight: 600;
}

.appointment-info .description-value {
  color: #5f6f81;
  font-size: 0.875rem;
  font-style: normal;
  line-height: 1.4;
}

/* Status */
.appointment-info .status-label {
  font-size: 0.75rem;
  color: #95a5a6;
}

.appointment-info .status-value {
  font-size: 0.75rem;
}

.appointment-info .status-value.status-concluido {
  color: var(--status-green);
}

.appointment-info .status-value.status-cancelado {
  color: var(--status-red);
}

.appointment-info .status-value.status-agendado {
  color: var(--status-yellow);
}

.appointment-info .status-value.status-espera {
  color: var(--status-orange);
}

/* Estilo para o link do paciente */
.patient-link {
  color: var(--doctor-highlight); /* Invertido: agora azul claro (#007bff) */
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.patient-link:hover {
  color: var(--primary-light);
  transform: scale(1.02); /* Pequena animação de escala */
}

/* Botões de navegação */
.navigation-buttons {
  display: flex;
  gap: 0.5rem;
}

button {
  padding: 0.5rem 1rem;
  background: var(--primary-light);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  transition: var(--transition);
}

button:hover {
  background: var(--primary-dark);
  transform: translateY(-2px); /* Elevação sutil no hover */
  box-shadow: 0 2px 4px var(--shadow-dark); /* Sombra leve */
}

/* Estilo para o botão Cancelar */
button.cancelar {
  background: var(--cancel-red);
}

button.cancelar:hover {
  background: var(--cancel-dark);
}

/* Estilo para o botão Reagendar */
button.reagendar {
  background: var(--reagendar-yellow);
  color: var(--text-dark);
}

button.reagendar:hover {
  background: var(--reagendar-dark);
}

/* Sem agendamentos */
.no-appointments {
  text-align: center;
  font-size: 0.875rem;
  color: #7f8c8d;
  padding: 1rem;
  background: #f9fbfc;
  border-radius: 6px;
  animation: fadeIn 0.5s ease-out; /* Animação para consistência */
}

/* Loading */
.loading {
  font-size: 0.875rem;
  color: #7f8c8d;
  margin-top: 1rem;
  text-align: center;
  animation: fadeIn 0.5s ease-out;
}

/* Responsividade */
@media (max-width: 768px) {
  .agenda-container {
    padding: 1rem;
  }

  .tabs {
    gap: 0.25rem;
    justify-content: flex-start;
  }

  .tab-button {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
  }

  .agenda-container h2 {
    font-size: 1.25rem;
  }

  .agenda-item {
    padding: 0.5rem 0.75rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .appointment-info {
    font-size: 0.75rem;
  }

  .appointment-info .doctor-label,
  .appointment-info .doctor-value {
    font-size: 1rem;
  }

  .appointment-info .time-value {
    font-size: 0.875rem;
  }

  .navigation-buttons {
    width: 100%;
    justify-content: flex-start;
  }

  button {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .agenda-container {
    padding: 0.75rem;
  }

  .agenda-item {
    padding: 0.5rem;
  }
}