/* style.css - Versão Melhorada para Agenda */
:root {
  --primary: #135300	;
  --primary-hover: #135300	;
  --secondary: #135300	;
  --secondary-hover: #135300	;
  --border-gray: #e5e7eb;
  --success: #4284e0;
  --warning: #f59e0b;
  --error: #ef4444;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
}

body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Cores */
.bg-primary { background: var(--primary); }
.text-primary { color: var(--primary); }
.bg-secondary { background: var(--secondary); }
.text-secondary { color: var(--secondary); }
.bg-success { background: var(--success); }
.text-success { color: var(--success); }
.bg-warning { background: var(--warning); }
.text-warning { color: var(--warning); }
.bg-error { background: var(--error); }
.text-error { color: var(--error); }

/* Header */
header {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Botões */
.btn-primary,
.btn-secondary,
.btn-white,
.btn-success,
.btn-warning {
  padding: .6rem 1rem;
  border-radius: .5rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  background: var(--secondary);
  color: white;
}
.btn-secondary:hover {
  background: var(--secondary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover {
  background: #1D8100;
  transform: translateY(-1px);
}

.btn-warning {
  background: var(--warning);
  color: white;
}
.btn-warning:hover {
  background: #e58a08;
  transform: translateY(-1px);
}

.btn-white {
  background: white;
  color: var(--gray-800);
  border-color: var(--border-gray);
}
.btn-white:hover {
  background-color: var(--gray-50);
  border-color: var(--gray-300);
  transform: translateY(-1px);
}

/* Botões desabilitados */
.btn-primary:disabled,
.btn-secondary:disabled,
.btn-success:disabled,
.btn-warning:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-sm {
  padding: .4rem .8rem;
  font-size: .85rem;
  border-radius: .375rem;
}

.btn-xs {
  padding: .25rem .5rem;
  font-size: .75rem;
  border-radius: .25rem;
}

/* Inputs */
.input {
  width: 100%;
  padding: .75rem;
  border: 1px solid var(--border-gray);
  border-radius: .5rem;
  outline: none;
  transition: all 0.2s ease;
  background: white;
  font-size: 0.95rem;
}

.input:focus {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.input:disabled {
  background-color: var(--gray-50);
  color: var(--gray-600);
  cursor: not-allowed;
}

/* Container da Agenda */
#agenda-container {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--gray-200);
}

/* Cards e Elementos da Agenda */
.agenda-day {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 0.75rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
}

.agenda-day:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

.agenda-day-header {
  display: flex;
  justify-content: between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--gray-200);
}

.agenda-day-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-800);
  margin: 0;
}

.agenda-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.slot-item {
  background: white;
  border: 2px solid var(--gray-200);
  border-radius: 0.5rem;
  padding: 0.75rem;
  text-align: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.slot-item:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.slot-item.disponivel {
  border-color: var(--success);
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
}

.slot-item.ocupado {
  border-color: var(--error);
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  cursor: not-allowed;
}

.slot-item.reservado {
  border-color: var(--warning);
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
}

.slot-horario {
  font-weight: 600;
  color: var(--gray-800);
  font-size: 0.9rem;
}

.slot-status {
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 1rem;
  display: inline-block;
}

.status-disponivel {
  background: var(--success);
  color: white;
}

.status-ocupado {
  background: var(--error);
  color: white;
}

.status-reservado {
  background: var(--warning);
  color: white;
}

/* Modal */
#modal {
  backdrop-filter: blur(4px);
}

#modal > div {
  border-radius: 1rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--gray-200);
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading-spinner {
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--primary);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  display: inline-block;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Mensagens de estado */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--gray-600);
}

.empty-state svg {
  margin: 0 auto 1rem;
  opacity: 0.5;
}

/* Responsividade */
@media (max-width: 768px) {
  .agenda-slots {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
  }
  
  .agenda-day {
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .agenda-day-title {
    font-size: 1.1rem;
  }
  
  .slot-item {
    padding: 0.5rem;
  }
}

@media (max-width: 480px) {
  .agenda-slots {
    grid-template-columns: 1fr 1fr;
  }
  
  header {
    padding: 1rem;
  }
  
  header > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Utilitários extras */
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.shadow-sm { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
.shadow-md { box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); }
.border { border-width: 1px; }

/* Animações suaves */
.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
/* ===== HEADER RESPONSIVO ===== */
header {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Botões no header */
header .btn-white {
  background: rgba(255, 255, 255, 0.95);
  color: var(--primary);
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
  backdrop-filter: blur(10px);
}

header .btn-white:hover {
  background: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

header .btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

/* ===== RESPONSIVIDADE ESPECÍFICA ===== */
@media (max-width: 640px) {
  /* Header mobile */
  header {
    padding: 1rem;
  }
  
  /* Ajuste do layout do header */
  header > div {
    gap: 1rem;
  }
  
  /* Menu de usuário em coluna */
  header .flex-col {
    align-items: stretch;
  }
  
  /* Botões ocupam largura total no mobile */
  header .flex.gap-2 {
    display: flex;
    gap: 0.5rem;
  }
  
  header .btn-white {
    flex: 1;
    text-align: center;
    justify-content: center;
    padding: 0.6rem 0.5rem;
  }
  
  /* Nome do usuário */
  #user-name {
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  /* Ajustes para telas muito pequenas */
  header {
    padding: 0.75rem;
  }
  
  header .btn-white {
    padding: 0.5rem 0.4rem;
    font-size: 0.8rem;
  }
  
  #user-name {
    font-size: 0.85rem;
  }
  
  .logo {
    height: 6rem !important;
  }
}

/* ===== UTILITÁRIOS ADICIONAIS ===== */
.whitespace-nowrap {
  white-space: nowrap;
}

/* Garantir que imagens sejam responsivas */
img {
  max-width: 100%;
  height: auto;
}

/* Melhorar legibilidade do texto no mobile */
@media (max-width: 640px) {
  body {
    font-size: 14px;
  }
  
  .text-sm {
    font-size: 0.8rem;
  }
}
