/* ========== RESET & BASE ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --gold: #e4c194;
  --gold-dark: #b28b5e;
  --gold-soft: #f9efdc;
  --bg-dark: #0c0c14;
  --card-bg: rgba(18, 22, 32, 0.65);
  --card-border: rgba(228, 193, 148, 0.3);
  --border-glow: rgba(228, 193, 148, 0.6);
  --transition-smooth: cubic-bezier(0.2, 0.9, 0.4, 1.1);
  --shadow-premium: 0 25px 50px -12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --font-serif: 'Playfair Display', serif;
  --font-sans: 'Inter', sans-serif;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-dark);
  color: #f0f0f5;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ========== FUNDO DINÂMICO ========== */
.bg-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 30%, rgba(228, 193, 148, 0.1), transparent 55%),
    radial-gradient(circle at 85% 70%, rgba(228, 193, 148, 0.08), transparent 60%),
    repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.02) 0px, rgba(0, 0, 0, 0.02) 2px, transparent 2px, transparent 8px);
  z-index: -2;
  animation: slowDrift 40s infinite alternate;
}

@keyframes slowDrift {
  0% { transform: scale(1) translate(0, 0); opacity: 0.8; }
  100% { transform: scale(1.05) translate(1%, 1%); opacity: 1; }
}

.bg-noise {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='1' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: -1;
}

/* ========== GLASS CARD PREMIUM ========== */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 48px;
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-premium);
  transition: transform 0.4s var(--transition-smooth), box-shadow 0.5s ease;
  animation: fadeInUp 0.8s var(--transition-smooth) forwards;
}

.glass-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(35px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ========== BOTÕES COM RIPPLE E GLOW ========== */
.btn {
  position: relative;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(4px);
  padding: 12px 28px;
  border-radius: 60px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.25s var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: white;
  border: 1px solid var(--card-border);
  overflow: hidden;
  z-index: 1;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transform: translate(-50%, -50%);
  transition: width 0.5s, height 0.5s;
  z-index: -1;
}

.btn:active::before {
  width: 300%;
  height: 300%;
  opacity: 0;
  transition: 0s;
}

.btn-primary {
  background: linear-gradient(125deg, var(--gold), var(--gold-dark));
  color: #0A0A0F;
  border: none;
  box-shadow: 0 6px 18px rgba(228, 193, 148, 0.4);
}

.btn-primary:hover {
  transform: scale(1.02) translateY(-2px);
  box-shadow: 0 12px 28px rgba(228, 193, 148, 0.5);
  background: linear-gradient(125deg, var(--gold-dark), var(--gold));
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--card-border);
}

.btn-secondary:hover {
  background: rgba(228, 193, 148, 0.25);
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ========== INPUTS ========== */
input, select {
  width: 100%;
  padding: 14px 22px;
  background: rgba(12, 15, 25, 0.7);
  border: 1px solid rgba(228, 193, 148, 0.4);
  border-radius: 40px;
  color: #fff;
  font-size: 0.9rem;
  transition: all 0.3s;
  outline: none;
  backdrop-filter: blur(4px);
}

input:focus, select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(228, 193, 148, 0.2);
  background: rgba(12, 15, 25, 0.9);
}
select option { background: var(--bg-dark); color: #fff; }

/* ========== TABS ========== */
.tabs-nav {
  display: flex;
  gap: 16px;
  margin-bottom: 36px;
  border-bottom: 1px solid rgba(228, 193, 148, 0.3);
  padding-bottom: 12px;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 8px 28px;
  font-weight: 600;
  color: #aaa;
  cursor: pointer;
  transition: all 0.3s;
  border-radius: 40px;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

.tab-btn i {
  margin-right: 8px;
}

.tab-btn.active {
  color: var(--gold);
  background: rgba(228, 193, 148, 0.2);
  transform: translateY(-2px);
}

.tab-content {
  display: none;
  animation: fadeScale 0.5s var(--transition-smooth);
}

.tab-content.active {
  display: block;
}

@keyframes fadeScale {
  0% { opacity: 0; transform: scale(0.98); }
  100% { opacity: 1; transform: scale(1); }
}

/* ========== TOGGLE SERVIÇOS ========== */
.toggle-services-btn {
  width: 100%;
  justify-content: center;
  margin-bottom: 10px;
}

.services-wrapper {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.5s ease-in-out, opacity 0.4s ease-in-out, margin-top 0.3s ease-in-out;
}

.services-wrapper.open {
  max-height: 800px; /* Expande o suficiente para mostrar a lista */
  opacity: 1;
  margin-top: 20px;
}

/* ========== ADMIN SUBTABS ========== */
.admin-subtabs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(228,193,148,0.3);
  padding-bottom: 12px;
  flex-wrap: wrap;
}
.admin-subtab-btn {
  background: transparent;
  border: none;
  padding: 6px 20px;
  border-radius: 40px;
  font-weight: 500;
  color: #aaa;
  cursor: pointer;
  transition: 0.2s;
}
.admin-subtab-btn.active {
  background: rgba(228,193,148,0.2);
  color: var(--gold);
}
.admin-tab-content {
  animation: fadeScale 0.3s;
}

/* ========== SERVIÇOS (CARDS) ========== */
.servico-card {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 30px;
  padding: 14px 20px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.3s var(--transition-smooth);
  border-left: 3px solid transparent;
  font-weight: 500;
  backdrop-filter: blur(4px);
}

.servico-card:hover {
  background: rgba(228, 193, 148, 0.2);
  transform: translateX(8px);
  border-left-color: var(--gold);
}

.servico-card.selected {
  background: linear-gradient(115deg, var(--gold), var(--gold-dark));
  color: #0A0A0F;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(228, 193, 148, 0.3);
  border-left-color: transparent;
}

.badge-hot {
  background: linear-gradient(135deg, #ff7e5e, #ff416c);
  font-size: 0.7rem;
  padding: 4px 12px;
  border-radius: 60px;
  margin-left: 12px;
  display: inline-block;
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* ========== GRADE DE HORÁRIOS ========== */
.times-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.time-slot {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(228, 193, 148, 0.4);
  border-radius: 60px;
  padding: 12px;
  text-align: center;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(4px);
}

.time-slot:hover:not(.disabled) {
  background: var(--gold);
  color: #0A0A0F;
  transform: scale(1.03);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.time-slot.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  text-decoration: line-through;
}

.time-slot.selected-time {
  background: var(--gold);
  color: #0A0A0F;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transform: scale(1.02);
}

/* ========== TOAST ========== */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: rgba(10, 10, 15, 0.9);
  backdrop-filter: blur(16px);
  padding: 14px 32px;
  border-radius: 60px;
  border-left: 4px solid var(--gold);
  color: white;
  font-size: 0.9rem;
  z-index: 200;
  transform: translateY(40px);
  opacity: 0;
  transition: all 0.4s var(--transition-smooth);
  pointer-events: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ========== LOADER ========== */
.loader {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  border-top-color: var(--gold);
  animation: spin 0.7s linear infinite;
  box-shadow: 0 0 6px rgba(228, 193, 148, 0.5);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ========== HISTÓRICO ========== */
.history-item {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 32px;
  padding: 20px;
  margin-bottom: 16px;
  border-left: 4px solid var(--gold);
  transition: all 0.3s;
  backdrop-filter: blur(4px);
}

.history-item:hover {
  transform: translateX(8px);
  background: rgba(228, 193, 148, 0.08);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}

/* ========== ADMIN CARDS ========== */
.admin-service-item, .admin-prof-item, .working-hour-item {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 28px;
  padding: 16px 20px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.admin-service-item button, .admin-prof-item button {
  padding: 6px 16px;
  font-size: 0.8rem;
}
.working-hour-item {
  display: grid;
  grid-template-columns: 100px 1fr 1fr auto;
  gap: 12px;
  align-items: center;
}
.working-hour-item select, .working-hour-item input {
  margin: 0;
  padding: 8px 12px;
}
.delete-btn {
  background: rgba(255, 80, 80, 0.2);
  border-color: #ff5050;
}
.delete-btn:hover {
  background: rgba(255, 80, 80, 0.5);
}

/* ========== AUTENTICAÇÃO ========== */
.auth-switch {
  text-align: center;
  margin-top: 24px;
  font-size: 0.85rem;
  color: #aaa;
}

.auth-switch span {
  color: var(--gold);
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
  border-bottom: 1px dashed transparent;
}

.auth-switch span:hover {
  border-bottom-color: var(--gold);
  letter-spacing: 0.3px;
}

/* ========== MODAL ADICIONAR SERVIÇO ========== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  width: 90%;
  max-width: 420px;
  padding: 30px;
  transform: scale(0.9);
  transition: transform 0.3s var(--transition-smooth);
}

.modal-overlay.active .modal-box {
  transform: scale(1);
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold-dark);
}

/* ========== RESPONSIVIDADE ========== */
@media (max-width: 700px) {
  body {
    padding: 16px;
  }
  .glass-card {
    padding: 28px !important;
  }
  .tabs-nav {
    gap: 8px;
  }
  .tab-btn {
    padding: 6px 18px;
    font-size: 0.75rem;
  }
  .btn {
    padding: 10px 22px;
    font-size: 0.85rem;
  }
  .times-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
  }
  .time-slot {
    padding: 8px;
  }
  .toast {
    bottom: 20px;
    right: 20px;
    left: 20px;
    text-align: center;
  }
  .admin-subtabs {
    gap: 6px;
  }
  .admin-subtab-btn {
    padding: 4px 12px;
    font-size: 0.75rem;
  }
  .working-hour-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
