/* ===== BOOKING SYSTEM SAAS v5.4 - 3 PAGES LAYOUT ===== */

:root {
  --primary-color: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #6366f1;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --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;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  color: var(--gray-800);
  line-height: 1.5;
}

body {
  overflow: hidden;
}

/* ===== APP CONTAINER ===== */
.app {
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

/* ===== PAGES ===== */
.page {
  display: none;
  width: 100%;
  max-width: 600px;
  animation: pageFadeIn 0.4s ease-out;
}

.page.active {
  display: block;
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== HOME PAGE ===== */
.home-card {
  background: white;
  border-radius: 24px;
  padding: 48px 40px;
  box-shadow: var(--shadow-2xl);
  text-align: center;
}

.home-header {
  margin-bottom: 40px;
}

.home-header h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.home-header .subtitle {
  font-size: 16px;
  color: var(--gray-500);
  font-weight: 500;
}

.home-buttons {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.home-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 28px;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  width: 100%;
}

.home-btn-icon {
  font-size: 32px;
  flex-shrink: 0;
}

.home-btn-text {
  font-size: 18px;
  font-weight: 700;
  color: white;
  display: block;
}

.home-btn-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  display: block;
  margin-top: 4px;
}

.home-btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
}

.home-btn-primary:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-xl);
}

.home-btn-danger {
  background: linear-gradient(135deg, var(--danger-color), #dc2626);
  color: white;
}

.home-btn-danger:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-xl);
}

/* ===== BOOKING PAGE ===== */
.booking-page-card {
  background: white;
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow-2xl);
  max-width: 500px;
  margin: 0 auto;
}

.booking-page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--gray-100);
}

.back-btn {
  padding: 8px 12px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  background: white;
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.back-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.booking-page-header h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
  flex: 1;
  line-height: 1.3;
}

/* Month Navigation */
.month-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}

.month-nav-btn {
  width: 36px;
  height: 36px;
  border: 2px solid var(--gray-200);
  border-radius: 10px;
  background: white;
  font-size: 20px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
}

.month-nav-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: white;
}

.current-month {
  font-size: 18px;
  font-weight: 800;
  color: var(--gray-900);
}

/* Calendar View */
.calendar-view {
  margin-bottom: 16px;
}

.weekdays-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 4px;
}

.weekdays-row span {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  padding: 4px 0;
}

.month-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  padding: 4px;
}

.calendar-day:hover:not(.disabled):not(.blank) {
  transform: scale(1.1);
  z-index: 10;
}

.calendar-day.blank {
  background: transparent;
  cursor: default;
}

.calendar-day.disabled {
  background: transparent;
  color: var(--gray-300);
  cursor: not-allowed;
}

.calendar-day.today {
  border: 2px solid var(--primary-color);
}

/* Calendar States */
.calendar-day.available {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
}

.calendar-day.available:hover {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: var(--shadow-md);
}

.calendar-day.selected {
  background: var(--primary-color) !important;
  color: white !important;
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
}

.calendar-day.weekend {
  background: linear-gradient(135deg, #fef3c7 0%, #fcd34d 100%);
  color: #92400e;
}

.calendar-day.closed {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
}

.calendar-day.full {
  background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
  color: #374151;
}

/* Time Slots Section */
.time-slots-section {
  border-top: 2px solid var(--gray-100);
  padding-top: 12px;
}

.time-slots-section h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 10px;
  text-align: center;
}

.time-slots-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.time-slot {
  padding: 10px 6px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  background: var(--gray-50);
}

.time-slot:hover {
  border-color: var(--primary-color);
  background: white;
  transform: scale(1.05);
  box-shadow: var(--shadow-sm);
}

.time-slot.selected {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  transform: scale(1.05);
}

.time-slot.unavailable {
  background: var(--gray-200);
  color: var(--gray-400);
  cursor: not-allowed;
  border-color: var(--gray-300);
}

.time-slot.unavailable:hover {
  transform: none;
  background: var(--gray-200);
}

/* ===== DATA PAGE ===== */
.form-page-card {
  background: white;
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow-2xl);
}

.form-page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--gray-100);
}

.form-page-header h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
}

.selected-info {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 24px;
  text-align: center;
}

.selected-info p {
  color: white;
  font-size: 16px;
  font-weight: 600;
}

.form-group {
  margin-bottom: 14px;
}

.form-input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  font-size: 15px;
  font-family: inherit;
  transition: var(--transition);
  background: var(--gray-50);
  color: var(--gray-900);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: white;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.form-input::placeholder {
  color: var(--gray-400);
}

.form-input.textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
}

/* ===== BUTTONS ===== */
.btn {
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary { background: var(--primary-color); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-2px); }

.btn-success { background: var(--success-color); color: white; }
.btn-success:hover:not(:disabled) { background: #059669; transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.btn-danger { background: var(--danger-color); color: white; }
.btn-danger:hover:not(:disabled) { background: #dc2626; transform: translateY(-2px); }

.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover:not(:disabled) { background: var(--gray-300); transform: translateY(-2px); }

.btn-block { width: 100%; margin-bottom: 12px; }
.btn-block:last-child { margin-bottom: 0; }

/* ===== MODAL ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  z-index: 1000;
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: white;
  border-radius: 24px;
  padding: 32px;
  text-align: center;
  max-width: 420px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-2xl);
  animation: modalSlideIn 0.4s ease-out;
}

.modal-content.error { border-top: 4px solid var(--danger-color); }

.modal-header-danger {
  margin-bottom: 24px;
}

.modal-header-danger .error-icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.modal-header-danger h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--danger-color);
}

.success-icon, .error-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: white;
  margin: 0 auto 20px;
}

.success-icon { background: linear-gradient(135deg, var(--success-color), #059669); }
.error-icon { background: linear-gradient(135deg, var(--danger-color), #dc2626); }

.modal-content h2 { font-size: 24px; font-weight: 700; color: var(--gray-900); margin-bottom: 12px; }
.modal-content p { font-size: 14px; color: var(--gray-600); margin-bottom: 24px; line-height: 1.6; }
.modal-content .btn { width: 100%; margin-bottom: 10px; }
.modal-content .btn:last-child { margin-bottom: 0; }

@keyframes modalSlideIn {
  from { opacity: 0; transform: scale(0.9) translateY(-20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .app { padding: 12px; }
  
  .home-card { padding: 36px 24px; }
  .home-header h1 { font-size: 26px; }
  .home-btn { padding: 20px; }
  .home-btn-icon { font-size: 28px; }
  .home-btn-text { font-size: 16px; }
  
  .booking-page-card, .form-page-card { padding: 20px; }
  .booking-page-header h2 { font-size: 15px; }
  .current-month { font-size: 18px; }
  .calendar-day { font-size: 13px; border-radius: 8px; }
  .time-slots-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
  .app { padding: 8px; height: 100dvh; }
  
  .home-card { padding: 28px 20px; border-radius: 20px; }
  .home-header h1 { font-size: 22px; }
  .home-header .subtitle { font-size: 14px; }
  .home-btn { padding: 16px; flex-direction: column; text-align: center; gap: 8px; }
  .home-btn-icon { font-size: 36px; }
  
  .booking-page-card, .form-page-card { padding: 16px; border-radius: 20px; }
  .back-btn { padding: 8px 12px; font-size: 12px; }
  .booking-page-header h2 { font-size: 13px; }
  .month-nav-btn { width: 36px; height: 36px; font-size: 20px; }
  .current-month { font-size: 16px; }
  .weekdays-row span { font-size: 10px; }
  .calendar-day { font-size: 11px; }
  .time-slots-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .time-slot { padding: 10px 6px; font-size: 12px; }
  
  .form-input { padding: 12px 14px; font-size: 14px; }
  .btn { padding: 12px 20px; font-size: 14px; }
}

/* ===== DARK MODE ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --gray-50: #1f2937; --gray-100: #111827; --gray-200: #374151;
    --gray-300: #4b5563; --gray-400: #6b7280; --gray-500: #9ca3af;
    --gray-600: #d1d5db; --gray-700: #e5e7eb; --gray-800: #f3f4f6; --gray-900: #f9fafb;
  }
  body, .app { background: linear-gradient(135deg, #1f2937 0%, #111827 100%); }
  .home-card, .booking-page-card, .form-page-card { background: var(--gray-100); }
  .form-input { background: var(--gray-200); color: var(--gray-900); border-color: var(--gray-300); }
  .form-input:focus { background: var(--gray-100); }
  .booking-page-header, .form-page-header { border-bottom-color: var(--gray-200); }
  .booking-page-header h2, .form-page-header h2, .current-month { color: var(--gray-900); }
  .weekdays-row span { color: var(--gray-600); }
  .calendar-day.available { background: linear-gradient(135deg, #064e3b 0%, #059669 100%); color: #f9fafb; }
  .calendar-day.weekend { background: linear-gradient(135deg, #78350f 0%, #b45309 100%); color: #fef3c7; }
  .calendar-day.closed { background: linear-gradient(135deg, #7f1d1d 0%, #dc2626 100%); color: #fee2e2; }
  .calendar-day.full { background: linear-gradient(135deg, #374151 0%, #4b5563 100%); color: #e5e7eb; }
  .back-btn { background: var(--gray-200); border-color: var(--gray-300); color: var(--gray-700); }
  .month-nav-btn { background: var(--gray-200); border-color: var(--gray-300); color: var(--gray-700); }
  .time-slot { background: var(--gray-200); border-color: var(--gray-300); color: var(--gray-700); }
  .time-slots-section { border-top-color: var(--gray-200); }
}

@media print {
  .btn, .modal { display: none; }
}

