/* ========================================
   SALÃO BEAUTY - Mobile First CSS
   Design impecável para celular
   ======================================== */

:root {
  --primary: #ec4899;
  --primary-dark: #db2777;
  --primary-light: #fce7f3;
  --secondary: #8b5cf6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --dark: #1f2937;
  --gray: #6b7280;
  --gray-light: #f3f4f6;
  --white: #ffffff;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --radius: 16px;
  --radius-sm: 8px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  touch-action: manipulation;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
  min-height: 100vh;
  color: var(--dark);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ========================================
   HEADER
   ======================================== */
.header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header h1 {
  font-size: 1.25rem;
  font-weight: 700;
}

.btn-primary {
  background: var(--white);
  color: var(--primary);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow);
}

.btn-primary:active {
  transform: scale(0.95);
}

.btn-primary span {
  font-size: 1.25rem;
  line-height: 1;
}

/* ========================================
   NAVEGAÇÃO DE DATAS (TOPO)
   ======================================== */
.date-nav {
  background: var(--white);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-light);
}

.btn-icon {
  background: var(--gray-light);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon:active {
  background: var(--primary-light);
  transform: scale(0.95);
}

.date-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
}

.date-display span {
  text-align: center;
}

#data-semana {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray);
  font-weight: 500;
}

#data-dia {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

#data-mes {
  font-size: 0.875rem;
  color: var(--gray);
}

/* ========================================
   CALENDÁRIO MENSAL COMPACTO
   ======================================== */
.calendar-section {
  background: var(--white);
  padding: 0.75rem;
  border-bottom: 1px solid var(--gray-light);
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.calendar-header h2 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--dark);
  text-transform: capitalize;
}

.btn-icon-small {
  background: transparent;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 1rem;
  color: var(--gray);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon-small:hover {
  background: var(--gray-light);
  color: var(--primary);
}

.btn-icon-small:active {
  transform: scale(0.9);
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.125rem;
  margin-bottom: 0.25rem;
}

.calendar-weekdays span {
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--gray);
  padding: 0.25rem 0;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.125rem;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  min-height: 36px;
  max-height: 44px;
  padding-top: 2px;
}

.calendar-day:hover {
  background: var(--gray-light);
}

.calendar-day.other-month {
  color: #d1d5db;
}

.calendar-day.today {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 600;
}

.calendar-day.selected {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 1px 4px rgba(236, 72, 153, 0.4);
}

.calendar-day.selected .day-count {
  background: rgba(255, 255, 255, 0.3);
  color: var(--white);
}

.calendar-day .day-number {
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
}

.calendar-day .day-count {
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 1px 4px;
  border-radius: 8px;
  margin-top: 2px;
  min-width: 16px;
  text-align: center;
}

/* ========================================
   FILTROS
   ======================================== */
.filters {
  background: var(--white);
  padding: 0.75rem 1.25rem 1rem;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-bottom: 1px solid var(--gray-light);
}

.filters::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  background: var(--gray-light);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn.active {
  background: var(--primary);
  color: var(--white);
}

.filter-btn:active {
  transform: scale(0.95);
}

/* ========================================
   LISTA DE AGENDAMENTOS
   ======================================== */
.agenda-list {
  padding: 1rem;
  padding-bottom: 100px;
}

.loading {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gray);
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--gray);
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
  color: var(--dark);
}

/* Card de Agendamento */
.agendamento-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
  display: flex;
  gap: 1rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.agendamento-card:active {
  transform: scale(0.98);
}

.agendamento-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.agendamento-card.cabelo::before { background: linear-gradient(180deg, #8b5cf6, #a78bfa); }
.agendamento-card.sobrancelha::before { background: linear-gradient(180deg, #f59e0b, #fbbf24); }
.agendamento-card.unha::before { background: linear-gradient(180deg, #ec4899, #f472b6); }

.horario-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 60px;
}

.horario-badge .hora {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1;
}

.horario-badge .duracao {
  font-size: 0.6875rem;
  color: var(--gray);
  margin-top: 0.25rem;
}

.agendamento-info {
  flex: 1;
  min-width: 0;
}

.cliente-nome {
  font-weight: 600;
  font-size: 1rem;
  color: var(--dark);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.servico-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 50px;
  font-weight: 500;
}

.servico-tag.cabelo { background: #ede9fe; color: #7c3aed; }
.servico-tag.sobrancelha { background: #fef3c7; color: #d97706; }
.servico-tag.unha { background: #fce7f3; color: #db2777; }

.cliente-telefone {
  font-size: 0.8125rem;
  color: var(--gray);
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.status-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status-badge.agendado { background: var(--warning); }
.status-badge.confirmado { background: var(--success); }
.status-badge.cancelado { background: var(--danger); }
.status-badge.concluido { background: var(--gray); }

/* ========================================
   FLOATING ACTION BUTTON
   ======================================== */
.fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  border: none;
  font-size: 1.75rem;
  font-weight: 300;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fab:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
}

/* Esconde FAB em telas grandes */
@media (min-width: 768px) {
  .fab {
    display: none;
  }
}

/* ========================================
   MODAIS
   ======================================== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--white);
  width: 100%;
  max-height: 90vh;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow-y: auto;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem;
  border-bottom: 1px solid var(--gray-light);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 10;
}

.modal-header h2 {
  font-size: 1.125rem;
  font-weight: 600;
}

.btn-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--gray);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.btn-close:active {
  background: var(--gray-light);
}

/* ========================================
   FORMULÁRIOS
   ======================================== */
form {
  padding: 1.25rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

input, select, textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--gray-light);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--white);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

input::placeholder, textarea::placeholder {
  color: #9ca3af;
}

/* Opções de Serviço */
.service-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.service-option {
  position: relative;
  cursor: pointer;
}

.service-option input {
  position: absolute;
  opacity: 0;
}

.service-option span {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 0.5rem;
  border: 2px solid var(--gray-light);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
  transition: all 0.2s;
}

.service-option small {
  font-size: 0.625rem;
  color: var(--gray);
  margin-top: 0.25rem;
}

.service-option input:checked + span {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
}

.service-option:active span {
  transform: scale(0.95);
}

/* Botões do Formulário */
.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.form-actions button {
  flex: 1;
  padding: 1rem;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary {
  background: var(--gray-light);
  border: none;
  color: var(--gray);
}

.btn-secondary:active {
  background: #e5e7eb;
}

.form-actions .btn-primary {
  box-shadow: none;
}

/* ========================================
   DETALHES DO AGENDAMENTO
   ======================================== */
.detalhes-content {
  padding: 1.25rem;
}

.detalhe-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--gray-light);
}

.detalhe-item:last-child {
  border-bottom: none;
}

.detalhe-icon {
  width: 40px;
  height: 40px;
  background: var(--primary-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.detalhe-info h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray);
  margin-bottom: 0.25rem;
}

.detalhe-info p {
  font-size: 1rem;
  font-weight: 500;
  color: var(--dark);
}

.detalhe-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-light);
}

.btn-action {
  padding: 0.875rem;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.btn-confirmar {
  background: var(--success);
  color: var(--white);
}

.btn-cancelar-agendamento {
  background: var(--danger);
  color: var(--white);
}

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

.btn-whatsapp {
  background: #25d366;
  color: var(--white);
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
#toast-container {
  position: fixed;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  z-index: 300;
  pointer-events: none;
}

.toast {
  background: var(--dark);
  color: var(--white);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideDown 0.3s ease-out;
  pointer-events: auto;
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--danger);
}

.toast.warning {
  background: var(--warning);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   RESPONSIVIDADE
   ======================================== */
@media (min-width: 768px) {
  .modal {
    align-items: center;
    padding: 2rem;
  }
  
  .modal-content {
    max-width: 500px;
    border-radius: var(--radius);
    max-height: 85vh;
  }
  
  .agenda-list {
    max-width: 600px;
    margin: 0 auto;
  }
  
  .header {
    padding: 1rem 2rem;
  }
  
  .date-nav, 
  .calendar-section,
  .filters {
    padding-left: 2rem;
    padding-right: 2rem;
  }
  
  .calendar-day {
    min-height: 44px;
    max-height: 52px;
  }
}

/* ========================================
   UTILITÁRIOS
   ======================================== */
.hidden {
  display: none !important;
}

.skeleton {
  background: linear-gradient(90deg, var(--gray-light) 25%, #e5e7eb 50%, var(--gray-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
