/* === Base Reset & Typography === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #f59e0b;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--gray-800);
  line-height: 1.6;
  background: var(--gray-50);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Navbar === */
.navbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 2rem;
  background: white; border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
  position: sticky; top: 0; z-index: 100;
}
.nav-brand { font-size: 1.25rem; font-weight: 700; color: var(--gray-900); }
.nav-brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a { color: var(--gray-600); font-weight: 500; }
.nav-links a:hover { color: var(--primary); text-decoration: none; }

/* === Container === */
.container { max-width: 960px; margin: 0 auto; padding: 2rem 1rem; }

/* === Footer === */
.footer {
  text-align: center; padding: 2rem; color: var(--gray-400);
  border-top: 1px solid var(--gray-200); margin-top: 3rem;
}

/* === Buttons === */
.btn {
  display: inline-block; padding: 0.5rem 1rem;
  background: var(--gray-100); color: var(--gray-700);
  border: 1px solid var(--gray-300); border-radius: var(--radius);
  font-size: 0.875rem; font-weight: 500; cursor: pointer;
  text-decoration: none; transition: all 0.15s;
}
.btn:hover { background: var(--gray-200); text-decoration: none; }
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-sm { padding: 0.25rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 2rem; font-size: 1rem; }

/* === Alerts === */
.alert {
  padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-error { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: var(--success); border: 1px solid #bbf7d0; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* === Badges === */
.badge {
  display: inline-block; padding: 0.15rem 0.5rem;
  border-radius: 999px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-approved { background: #dbeafe; color: #1e40af; }
.badge-confirmed { background: #d1fae5; color: #065f46; }
.badge-denied { background: #fee2e2; color: #991b1b; }
.badge-canceled { background: var(--gray-200); color: var(--gray-600); }
.badge-completed { background: #e0e7ff; color: #3730a3; }

/* === Forms === */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.25rem; font-size: 0.9rem; color: var(--gray-700); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-300); border-radius: var(--radius);
  font-size: 0.95rem; font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }

/* === Hero / Carousel === */
.hero { margin: -2rem -1rem 2rem; position: relative; overflow: hidden; background: var(--gray-800); }
.photo-carousel { position: relative; width: 100%; max-height: 500px; }
.carousel-img { width: 100%; max-height: 500px; object-fit: cover; display: none; }
.carousel-img.active { display: block; }
.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,0.5); color: white; border: none;
  font-size: 2rem; padding: 0.5rem 1rem; cursor: pointer;
  z-index: 10; border-radius: var(--radius);
}
.carousel-btn.prev { left: 1rem; }
.carousel-btn.next { right: 1rem; }
.carousel-dots { position: absolute; bottom: 1rem; width: 100%; text-align: center; }
.dot {
  display: inline-block; width: 10px; height: 10px;
  background: rgba(255,255,255,0.5); border-radius: 50%;
  margin: 0 4px; cursor: pointer;
}
.dot.active { background: white; }
.hero-placeholder {
  padding: 4rem 2rem; text-align: center; color: white;
  background: linear-gradient(135deg, #1e3a5f 0%, #2d6a8f 100%);
}
.hero-placeholder h1 { font-size: 2.5rem; margin-bottom: 0.5rem; }

/* === Sections === */
.section { margin-bottom: 2.5rem; }
.section h2 { font-size: 1.5rem; margin-bottom: 1rem; color: var(--gray-900); }
.description { font-size: 1.05rem; color: var(--gray-600); line-height: 1.8; }

/* === Amenities === */
.amenities-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.amenity-tag {
  padding: 0.35rem 0.75rem; background: var(--gray-100);
  border: 1px solid var(--gray-200); border-radius: 999px;
  font-size: 0.85rem; color: var(--gray-700);
}

/* === Pricing === */
.pricing-card {
  background: white; padding: 1.5rem; border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--gray-200);
}
.price-main { font-size: 2rem; font-weight: 700; color: var(--gray-900); }
.price-per { font-size: 1rem; font-weight: 400; color: var(--gray-500); }
.price-details { margin-top: 1rem; list-style: none; }
.price-details li { padding: 0.25rem 0; color: var(--gray-600); }

/* === Calendar === */
.calendar-controls { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: 1rem; }
.calendar-month-label { font-size: 1.1rem; font-weight: 600; min-width: 160px; text-align: center; }
.calendar-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
  background: var(--gray-200); border-radius: var(--radius); overflow: hidden;
}
.calendar-grid .day-header {
  background: var(--gray-100); padding: 0.5rem; text-align: center;
  font-weight: 600; font-size: 0.8rem; color: var(--gray-500);
}
.calendar-grid .day {
  background: white; padding: 0.5rem; text-align: center;
  min-height: 50px; font-size: 0.9rem; position: relative;
}
.calendar-grid .day.empty { background: var(--gray-50); }
.calendar-grid .day.past { color: var(--gray-300); }
.calendar-grid .day.booked { background: #fee2e2; color: var(--danger); }
.calendar-grid .day.blocked { background: var(--gray-200); color: var(--gray-500); }
.calendar-grid .day.available { cursor: default; }
.calendar-grid .day.today { font-weight: 700; box-shadow: inset 0 0 0 2px var(--primary); }
.calendar-legend { display: flex; gap: 1.5rem; margin-top: 0.75rem; justify-content: center; }
.legend-item { display: flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; color: var(--gray-600); }
.legend-dot { width: 12px; height: 12px; border-radius: 50%; }
.legend-dot.available { background: white; border: 1px solid var(--gray-300); }
.legend-dot.booked { background: #fee2e2; }
.legend-dot.blocked { background: var(--gray-200); }

/* === CTA === */
.cta-section { text-align: center; padding: 2rem 0; }

/* === Booking Form === */
.booking-form { max-width: 600px; }
.pricing-preview {
  padding: 0.75rem 1rem; background: #eff6ff; border: 1px solid #bfdbfe;
  border-radius: var(--radius); margin-bottom: 1rem; font-size: 0.95rem;
}
.preview-detail { font-size: 0.85rem; color: var(--gray-500); }

/* === Success / Confirmation Pages === */
.success-page, .error-page, .auth-page { text-align: center; max-width: 500px; margin: 2rem auto; }
.success-icon { font-size: 3rem; color: var(--success); margin-bottom: 1rem; }
.pending-icon { font-size: 3rem; color: var(--warning); margin-bottom: 1rem; }
.info-icon { font-size: 3rem; color: var(--primary); margin-bottom: 1rem; }
.booking-summary {
  background: white; padding: 1.5rem; border-radius: var(--radius);
  box-shadow: var(--shadow); margin: 1.5rem 0; text-align: left;
}
.detail-table { width: 100%; }
.detail-table td { padding: 0.35rem 0.5rem; }
.detail-table td:first-child { font-weight: 600; width: 120px; color: var(--gray-500); }
.next-steps { text-align: left; margin: 1rem 0; padding-left: 1.5rem; }
.next-steps li { margin-bottom: 0.5rem; }

/* === Covenant === */
.covenant-text { margin: 1.5rem 0; }
.covenant-content {
  white-space: pre-wrap; font-family: inherit; font-size: 0.9rem;
  background: white; padding: 1.5rem; border-radius: var(--radius);
  border: 1px solid var(--gray-200); max-height: 400px; overflow-y: auto;
}
.covenant-form { margin-top: 1.5rem; }
.checkbox-label { display: flex; align-items: flex-start; gap: 0.5rem; margin-bottom: 1rem; cursor: pointer; font-weight: 500; }
.checkbox-label input { margin-top: 0.25rem; }

/* === Auth === */
.auth-form { max-width: 360px; margin: 2rem auto; text-align: left; }

/* === Admin === */
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.admin-nav {
  display: flex; gap: 0.5rem; margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--gray-200); padding-bottom: 0.5rem;
}
.admin-nav a {
  padding: 0.5rem 1rem; border-radius: var(--radius) var(--radius) 0 0;
  color: var(--gray-500); font-weight: 500;
}
.admin-nav a:hover { color: var(--gray-700); text-decoration: none; }
.admin-nav a.active { color: var(--primary); border-bottom: 2px solid var(--primary); margin-bottom: -2px; }

.admin-section { margin-bottom: 2rem; }
.admin-section h2 { font-size: 1.2rem; margin-bottom: 0.75rem; }

/* Booking Cards */
.booking-cards { display: grid; gap: 1rem; }
.booking-card {
  background: white; border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid var(--gray-200);
  overflow: hidden;
}
.card-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 1rem; background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}
.card-body { padding: 1rem; }
.card-body p { margin-bottom: 0.25rem; }
.card-actions { padding: 0.75rem 1rem; border-top: 1px solid var(--gray-100); display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

/* Admin Table */
.admin-table { width: 100%; border-collapse: collapse; background: white; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.admin-table th { background: var(--gray-50); padding: 0.75rem; text-align: left; font-size: 0.85rem; color: var(--gray-500); border-bottom: 1px solid var(--gray-200); }
.admin-table td { padding: 0.75rem; border-bottom: 1px solid var(--gray-100); }

/* Filter Bar */
.filter-bar { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }

/* Notes */
.notes-details { }
.notes-details summary { cursor: pointer; }
.notes-form { margin-top: 0.5rem; display: flex; gap: 0.5rem; align-items: flex-end; }
.notes-form textarea { width: 250px; font-size: 0.85rem; padding: 0.35rem; }

/* Photo Grid */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.photo-item { position: relative; background: white; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.photo-item img { width: 100%; height: 160px; object-fit: cover; }
.photo-actions { padding: 0.5rem; display: flex; gap: 0.5rem; justify-content: center; }

/* Upload */
.upload-form { display: flex; gap: 1rem; align-items: center; }

/* Settings */
.settings-form { max-width: 700px; }

/* iCal URL */
.ical-url { display: block; padding: 0.75rem; background: var(--gray-100); border-radius: var(--radius); word-break: break-all; }

/* Inline form */
.inline-form .form-row { align-items: flex-end; }

/* Utilities */
.text-muted { color: var(--gray-400); }
.text-sm { font-size: 0.85rem; }
.text-success { color: var(--success); }
.text-error { color: var(--danger); }

/* === Responsive === */
@media (max-width: 640px) {
  .navbar { padding: 0.75rem 1rem; }
  .nav-links { gap: 1rem; font-size: 0.9rem; }
  .container { padding: 1rem; }
  .hero { margin: -1rem -1rem 1.5rem; }
  .form-row { grid-template-columns: 1fr; }
  .admin-nav { overflow-x: auto; font-size: 0.85rem; }
  .admin-nav a { padding: 0.5rem; white-space: nowrap; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .hero-placeholder h1 { font-size: 1.75rem; }
  .price-main { font-size: 1.5rem; }
}
