@tailwind base;
@tailwind components;
@tailwind utilities;

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600&family=DM+Sans:wght@300;400;500&display=swap');

:root {
  --amber-50:  #fffbeb;
  --amber-100: #fef3c7;
  --amber-200: #fde68a;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --amber-700: #b45309;
  --amber-900: #78350f;

  --bg:          #fffbeb;
  --surface:     #ffffff;
  --surface-2:   #fef3c7;
  --text:        #78350f;
  --text-muted:  #b45309;
  --text-light:  #d97706;
  --border:      #fde68a;
  --accent:      #f59e0b;
  --accent-hover:#d97706;
  --shadow-sm:   0 1px 4px rgba(245, 158, 11, 0.07);
  --shadow-md:   0 4px 20px rgba(245, 158, 11, 0.12);
  --shadow-lg:   0 8px 40px rgba(245, 158, 11, 0.16);
  --radius:      14px;
  --transition:  all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  --success-color: #f59e0b;
  --success-bg:    #fef3c7;
  --error-color:   #c0392b;
  --error-bg:      #fdecea;
}

* { box-sizing: border-box; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0;
  line-height: 1.6;
  min-height: 100vh;
  /* Subtle texture */
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(245, 158, 11, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(251, 191, 36, 0.06) 0%, transparent 60%);
}

/* ── Container ── */
.container {
  max-width: 480px;
  margin: 3.5rem auto;
  background: var(--surface);
  padding: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

/* ── Header band ── */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.75rem 2rem 1.5rem;
  background: linear-gradient(135deg, #b45309 0%, #f59e0b 100%);
  position: relative;
  overflow: hidden;
}

/* Decorative circle */
.header::before {
  content: '';
  position: absolute;
  width: 180px;
  height: 180px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
  right: -50px;
  top: -60px;
  pointer-events: none;
}
.header::after {
  content: '';
  position: absolute;
  width: 100px;
  height: 100px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
  left: 30px;
  bottom: -50px;
  pointer-events: none;
}

.header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 600;
  margin: 0;
  color: #ffffff;
  letter-spacing: -0.3px;
  position: relative;
  z-index: 1;
}

.theme-toggle {
  background: rgba(255,255,255,0.15);
  color: #ffffff;
  border: 1px solid rgba(255,255,255,0.25);
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  backdrop-filter: blur(4px);
  position: relative;
  z-index: 1;
  width: auto;
}
.theme-toggle:hover {
  background: rgba(255,255,255,0.25);
  box-shadow: none;
}

/* ── Form area ── */
form, .subheadline, .info {
  padding-left: 2rem;
  padding-right: 2rem;
}

.subheadline {
  text-align: center;
  color: var(--text-muted);
  margin: 1.4rem 0 1.6rem;
  font-weight: 300;
  font-size: 0.9rem;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.subheadline::before,
.subheadline::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Fieldset ── */
fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

legend {
  display: none;
}

/* ── Form groups ── */
.form-group {
  margin-bottom: 1.15rem;
}

label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

input, select {
  width: 100%;
  padding: 0.72rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: 0.97rem;
  transition: var(--transition);
  background: var(--surface-2);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23b45309' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.2rem;
  cursor: pointer;
}

select option {
  background: var(--surface);
  color: var(--text);
}

small {
  display: block;
  margin-top: 0.35rem;
  color: var(--text-light);
  font-size: 0.8rem;
}

/* ── Buttons ── */
.flex-row {
  display: flex;
  gap: 0.65rem;
  margin-top: 0.5rem;
  padding-bottom: 2rem;
}

.flex-row button { flex: 1; }

button {
  padding: 0.8rem 1rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 9px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'DM Sans', sans-serif;
  letter-spacing: 0.1px;
}

button:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
  transform: translateY(-1px);
}
button:active { transform: scale(0.98) translateY(0); }
button:disabled {
  background: var(--border);
  color: var(--text-light);
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
  box-shadow: none;
}

button.secondary {
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--border);
  width: 100%;
}
button.secondary:hover {
  background: var(--amber-50);
  border-color: var(--accent);
  box-shadow: none;
}

.pending-bookings {
  padding: 1rem 2rem 1.5rem;
}
.pending-bookings h2 {
  margin-top: 0;
  font-size: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 0.6rem;
}
.booking-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  max-height: 220px;
  overflow-y: auto;
}
.booking-item {
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
}
.booking-item:last-child {
  border-bottom: none;
}
.booking-item .booking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.booking-toggle {
  background: transparent;
  border: none;
  color: var(--text);
  font-weight: 600;
  text-align: left;
  padding: 0;
  cursor: pointer;
  font-size: 0.9rem;
  flex: 1;
}
.booking-toggle:hover {
  color: var(--accent);
}
.booking-details {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  display: none;
  padding-left: 0.1rem;
}
.booking-item.expanded .booking-details {
  display: block;
}
.booking-list li.empty {
  color: var(--text-light);
  justify-content: center;
  display: flex;
}
.remove-booking {
  border: none;
  background: transparent;
  color: var(--error-color);
  cursor: pointer;
  font-weight: 700;
  padding: 0.2rem 0.4rem;
}

/* ── Info badge ── */
.info {
  text-align: center;
  color: var(--success-color);
  background: var(--success-bg);
  padding: 0.7rem 1.5rem;
  margin: 0 2rem 2rem;
  border-radius: 9px;
  font-weight: 500;
  font-size: 0.88rem;
  border: 1px solid rgba(245, 158, 11, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.info::before { content: '✨'; font-size: 1rem; }

/* ── Toast ── */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: 360px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.9rem 1.1rem;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  font-weight: 500;
  font-size: 0.9rem;
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1), fadeOut 0.3s ease 4.7s forwards;
  min-width: 280px;
}
.toast.success { border-left: 4px solid var(--success-color); background: var(--success-bg); }
.toast.error   { border-left: 4px solid var(--error-color);   background: var(--error-bg); }
.toast.info    { border-left: 4px solid var(--accent); }

.toast-icon { font-size: 18px; min-width: 22px; }
.toast-message { flex: 1; font-size: 0.9rem; line-height: 1.4; }

.toast-close {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  min-width: auto;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: var(--transition);
}
.toast-close:hover {
  background: rgba(0,0,0,0.08);
  color: var(--text);
  transform: none;
  box-shadow: none;
}

/* ── Animations ── */
@keyframes slideInRight {
  from { transform: translateX(400px); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(400px); }
}

/* ── Responsive ── */
@media (max-width: 560px) {
  .container { margin: 0.75rem; }
  .header { padding: 1.4rem 1.5rem 1.25rem; }
  .header h1 { font-size: 1.5rem; }
  form, .subheadline, .info { padding-left: 1.5rem; padding-right: 1.5rem; }
  .flex-row { padding-bottom: 1.5rem; }
  .info { margin: 0 1.5rem 1.5rem; }

  .toast-container { top: 1rem; right: 0.75rem; left: 0.75rem; max-width: none; }
  .toast { min-width: auto; }
}
