/* =====================================================
   Loch Mahon Booking System — Shared Styles
   Inherits design tokens from main site
   ===================================================== */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --lake-deep: #1a3a4a;
  --lake-mid: #2d6a8f;
  --lake-light: #4a8fb5;
  --green-deep: #2d5a3d;
  --green-mid: #4a7c59;
  --green-light: #6b9e7a;
  --cream: #f5f0e8;
  --cream-dark: #e8e0d4;
  --white: #faf9f7;
  --amber: #c8913a;
  --amber-hover: #b07d2e;
  --amber-light: #d4a85a;
  --text-dark: #1c2b1f;
  --text-mid: #3a4d3e;
  --text-light: #6b7d6f;
  --shadow-sm: 0 2px 8px rgba(26,58,74,0.08);
  --shadow-md: 0 4px 20px rgba(26,58,74,0.12);
  --shadow-lg: 0 8px 40px rgba(26,58,74,0.16);
  --radius: 12px;
  --radius-lg: 20px;
  --red: #c0392b;
  --red-light: #e74c3c;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Source Sans 3', 'Segoe UI', sans-serif;
  color: var(--text-dark);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: 'DM Serif Display', Georgia, serif;
  line-height: 1.2;
  font-weight: 400;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* ===== LAYOUT ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== BOOKING NAV ===== */
.booking-nav {
  background: var(--lake-deep);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.booking-nav .nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.booking-nav .nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: white;
}

.booking-nav .nav-logo img {
  height: 40px;
  width: auto;
}

.booking-nav .nav-logo span {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.1rem;
  opacity: 0.9;
}

.booking-nav .nav-links {
  display: flex;
  list-style: none;
  gap: 4px;
  align-items: center;
}

.booking-nav .nav-links a {
  color: rgba(255,255,255,0.8);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}

.booking-nav .nav-links a:hover,
.booking-nav .nav-links a.active {
  color: white;
  background: rgba(255,255,255,0.12);
}

.booking-nav .nav-links .nav-cta {
  background: var(--green-deep);
  color: white;
  margin-left: 8px;
}

.booking-nav .nav-links .nav-cta:hover {
  background: var(--green-mid);
}

.booking-nav .nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
}

.booking-nav .nav-user .user-name {
  font-weight: 500;
  color: white;
}

.booking-nav .nav-user .btn-logout {
  background: none;
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.8);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.booking-nav .nav-user .btn-logout:hover {
  border-color: rgba(255,255,255,0.5);
  color: white;
}

/* Quick-action buttons — visible on mobile only */
.booking-nav .nav-quick {
  display: none;
}

/* Mobile logout link — hidden on desktop, shown in hamburger on mobile */
.booking-nav .nav-links-logout {
  display: none;
}

/* Mobile nav toggle */
.booking-nav .hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.booking-nav .hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: white;
  margin: 5px 0;
  transition: 0.3s;
}

/* ===== PAGE HEADER ===== */
.page-header {
  background: linear-gradient(135deg, var(--lake-deep) 0%, var(--lake-mid) 100%);
  color: white;
  padding: 48px 0 36px;
  text-align: center;
}

.page-header h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.page-header p {
  opacity: 0.8;
  font-size: 1.05rem;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--green-deep);
  color: white;
}
.btn-primary:hover { background: var(--green-mid); }

.btn-secondary {
  background: var(--cream);
  color: var(--text-dark);
  border: 1px solid var(--cream-dark);
}
.btn-secondary:hover { background: var(--cream-dark); }

.btn-amber {
  background: var(--amber);
  color: white;
}
.btn-amber:hover { background: var(--amber-hover); }

.btn-danger {
  background: var(--red);
  color: white;
}
.btn-danger:hover { background: var(--red-light); }

.btn-outline {
  background: transparent;
  color: var(--text-mid);
  border: 1px solid var(--cream-dark);
}
.btn-outline:hover {
  background: var(--cream);
  border-color: var(--text-light);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 1.05rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== CARDS ===== */
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  border: 1px solid rgba(0,0,0,0.04);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--cream);
}

.card-header h3 {
  font-size: 1.2rem;
}

/* ===== FORMS ===== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-mid);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--cream-dark);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-dark);
  background: white;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--lake-mid);
  box-shadow: 0 0 0 3px rgba(45,106,143,0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-group .error-text {
  color: var(--red);
  font-size: 0.8rem;
  margin-top: 4px;
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-available {
  background: rgba(74,124,89,0.12);
  color: var(--green-deep);
}

.badge-booked {
  background: rgba(200,145,58,0.12);
  color: var(--amber-hover);
}

.badge-mine {
  background: rgba(45,106,143,0.12);
  color: var(--lake-mid);
}

.badge-cancelled {
  background: rgba(107,125,111,0.12);
  color: var(--text-light);
}

.badge-noshow {
  background: rgba(192,57,43,0.12);
  color: var(--red);
}

.badge-admin {
  background: rgba(45,106,143,0.12);
  color: var(--lake-deep);
}

.badge-flagged {
  background: rgba(192,57,43,0.15);
  color: var(--red);
  border: 1px solid rgba(192,57,43,0.25);
}

/* ===== SLOT TOGGLE ===== */
.slot-toggle {
  display: inline-flex;
  background: var(--cream);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
}

.slot-toggle button {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: var(--text-light);
  transition: all 0.2s;
}

.slot-toggle button.active {
  background: white;
  color: var(--text-dark);
  box-shadow: var(--shadow-sm);
}

.slot-toggle button:hover:not(.active) {
  color: var(--text-mid);
}

/* ===== DATE STRIP ===== */
.date-strip {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-strip .date-nav {
  background: white;
  border: 1px solid var(--cream-dark);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-mid);
  transition: all 0.2s;
  flex-shrink: 0;
}

.date-strip .date-nav:hover {
  background: var(--cream);
  color: var(--text-dark);
}

.date-strip .date-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.date-strip .dates {
  display: flex;
  gap: 6px;
  overflow: hidden;
  flex: 1;
}

.date-strip .date-btn {
  flex: 1;
  min-width: 0;
  padding: 10px 6px;
  border: 1.5px solid var(--cream-dark);
  border-radius: 10px;
  background: white;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.date-strip .date-btn:hover {
  border-color: var(--lake-light);
  background: rgba(45,106,143,0.04);
}

.date-strip .date-btn.active {
  border-color: var(--green-deep);
  background: var(--green-deep);
  box-shadow: 0 0 0 2px rgba(56,87,64,0.25);
}

.date-strip .date-btn.active .day-name,
.date-strip .date-btn.active .day-num,
.date-strip .date-btn.active .month {
  color: white;
}

.date-strip .date-btn .day-name {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-light);
  letter-spacing: 0.05em;
}

.date-strip .date-btn .day-num {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.2;
}

.date-strip .date-btn .month {
  display: block;
  font-size: 0.7rem;
  color: var(--text-light);
}

.date-strip .date-btn.today .day-name {
  color: var(--green-deep);
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: white;
  border-radius: 10px;
  padding: 14px 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  min-width: 280px;
  max-width: 400px;
  animation: toastIn 0.3s ease;
  border-left: 4px solid var(--green-mid);
}

.toast.error { border-left-color: var(--red); }
.toast.warning { border-left-color: var(--amber); }

.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  font-size: 1.2rem;
  margin-left: auto;
  padding: 0 4px;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,58,74,0.5);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: white;
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 480px;
  width: 100%;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease;
}

.modal h3 {
  margin-bottom: 16px;
  font-size: 1.3rem;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ===== LOADING SPINNER ===== */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-dark {
  border-color: rgba(0,0,0,0.1);
  border-top-color: var(--lake-mid);
}

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

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-light);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state h3 {
  color: var(--text-mid);
  margin-bottom: 8px;
}

/* ===== TABLE ===== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--cream-dark);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table-wrap th {
  background: var(--cream);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-mid);
  white-space: nowrap;
}

.table-wrap td {
  padding: 12px 16px;
  border-top: 1px solid var(--cream);
  vertical-align: middle;
}

.table-wrap tr:hover td {
  background: rgba(245,240,232,0.5);
}

/* ===== DIVIDER ===== */
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--text-light);
  font-size: 0.85rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--cream-dark);
}

/* ===== GOOGLE SSO BUTTON ===== */
.btn-google {
  background: white;
  border: 1.5px solid var(--cream-dark);
  color: var(--text-dark);
  font-weight: 500;
  width: 100%;
  padding: 14px 24px;
}

.btn-google:hover {
  background: var(--cream);
  border-color: var(--text-light);
}

.btn-google svg {
  width: 20px;
  height: 20px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .booking-nav .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(26,58,74,0.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    align-items: center;
    padding: 20px 16px;
    gap: 10px;
    border-top: 1px solid rgba(255,255,255,0.1);
    z-index: 100;
  }

  .booking-nav .nav-links.open {
    display: flex;
  }

  .booking-nav .nav-links a {
    display: block;
    width: 220px;
    text-align: center;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    border: 2px solid rgba(255,255,255,0.5);
    background: none;
  }

  .booking-nav .nav-links a.active {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.7);
  }

  .booking-nav .nav-links .nav-cta {
    background: var(--green-deep);
    border-color: rgba(255,255,255,0.5);
    margin-left: 0;
  }

  .booking-nav .nav-quick {
    display: flex;
    gap: 8px;
    align-items: center;
  }

  .booking-nav .nav-quick .nav-quick-btn {
    padding: 7px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    background: rgba(255,255,255,0.12);
    border: 1.5px solid rgba(255,255,255,0.35);
    border-radius: 8px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
  }

  .booking-nav .nav-quick .nav-quick-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.6);
  }

  .booking-nav .nav-quick .nav-quick-site {
    background: var(--green-deep);
    border-color: rgba(255,255,255,0.3);
  }

  .booking-nav .hamburger {
    display: block;
  }

  .booking-nav .nav-user {
    display: none;
  }

  .booking-nav .nav-links-logout {
    display: list-item;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 4px;
    padding-top: 4px;
  }

  .booking-nav .nav-links-logout a {
    opacity: 0.7;
    font-size: 0.85rem;
  }

  .page-header {
    padding: 32px 0 24px;
  }

  .page-header h1 {
    font-size: 1.5rem;
  }

  .date-strip .dates {
    gap: 4px;
  }

  .date-strip .date-btn {
    padding: 8px 4px;
  }

  .date-strip .date-btn .day-num {
    font-size: 1.1rem;
  }

  .modal {
    padding: 24px;
    margin: 12px;
  }

  .toast-container {
    left: 12px;
    right: 12px;
  }

  .toast {
    min-width: unset;
    max-width: unset;
  }
}
