/* Booking Calendar Styles */

/* Demo watermark overlay */
.booking-calendar-container::before {
  content: 'DEMO';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 8rem;
  font-weight: 900;
  color: rgba(241, 196, 15, 0.3);
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
  letter-spacing: 1rem;
  text-transform: uppercase;
  z-index: 200;
  pointer-events: none;
  user-select: none;
  animation: demo-pulse 5s ease-in-out infinite;
}

@keyframes demo-pulse {
  0%, 100% {
    opacity: 0.1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Background overlay to prevent interaction with elements behind calendar */
.booking-calendar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 65%; 
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  z-index: 149;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.booking-calendar-backdrop.show {
  opacity: 1;
}

/* Calendar container positioned within left column */
.booking-calendar-container {
  position: fixed;
  top: 50px;
  left: calc(1vw + 32.5% - 430px); /* ON TABLET THIS IS THE CALCULATION calc(1vw + 32.5% - 400px); ON PC ITS - 600PX*/
  width: calc(80% - 2vw);
  max-width: 900px; /* ON TABLET, THIS IS THE VALUE 900PX - on pc its 1200PX*/
  background: linear-gradient(135deg, rgba(40, 40, 40, 0.9), rgba(25, 25, 25, 0.9));  padding: 0;
  z-index: 150;
  border: 2px solid rgba(241, 196, 15, 0.4);
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 15px rgba(241, 196, 15, 0.1);
  color: #e0e0e0;
  margin-bottom: 0;
  display: none;
  max-height: calc(100vh - 100px);
  overflow: hidden;
}

.booking-calendar-header {
  padding: 8px 20px;
  background: linear-gradient(135deg, rgba(241, 196, 15, 0.15), rgba(243, 156, 18, 0.08));
  border-bottom: 2px solid rgba(241, 196, 15, 0.4);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.calendar-week-title {
  color: #f1c40f;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 300;
  margin: 0;
  flex: 1;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
  text-transform: uppercase;
  letter-spacing: 3px;
}

.calendar-nav-btn {
  background: linear-gradient(135deg, rgba(40, 40, 40, 0.9), rgba(25, 25, 25, 0.9));
  border: 2px solid rgba(241, 196, 15, 0.3);
  padding: 8px 12px;
  color: #f1c40f;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.2rem;
  min-width: 40px;
}

.calendar-nav-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(241, 196, 15, 0.2), rgba(243, 156, 18, 0.15));
  border-color: #f1c40f;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(241, 196, 15, 0.3);
}

.calendar-nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Time-based grid container */
.booking-calendar-grid-container {
  background: linear-gradient(135deg, rgba(20, 20, 20, 0.8), rgba(10, 10, 10, 0.8));
  padding: 15px;
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
}

/* Time-based grid layout: 8 columns (1 for times + 7 for days), 28px rows for hourly appearance (30% reduction) */
.booking-calendar-time-grid {
  display: grid;
  grid-template-columns: 42px repeat(7, 1fr);
  grid-auto-rows: 28px;
  gap: 1px;
  min-width: 420px;
  background: rgba(241, 196, 15, 0.1);
  padding: 2px;
  position: relative;
}

/* Time slot header (top-left empty cell) */
.time-slot-header {
  background: linear-gradient(135deg, rgba(241, 196, 15, 0.15), rgba(243, 156, 18, 0.08));
  border: 2px solid rgba(241, 196, 15, 0.4);
  grid-column: 1;
  grid-row: 1;
}

/* Day headers (top row) */
.calendar-day-header {
  background: linear-gradient(135deg, rgba(241, 196, 15, 0.15), rgba(243, 156, 18, 0.08));
  border-right: 2px solid rgba(241, 196, 15, 0.4);
  border-top: 2px solid rgba(241, 196, 15, 0.4);
  border: 2px solid rgba(241, 196, 15, 0.4);
  border-left: none;
  padding: 3px 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 32px;
}

.calendar-day-header.today {
  background: linear-gradient(135deg, rgba(241, 196, 15, 0.25), rgba(243, 156, 18, 0.15));
  border-color: #f1c40f;
  box-shadow: 0 0 10px rgba(241, 196, 15, 0.3);
  border-left: 2px solid rgba(241, 196, 15, 0.4);
}

.calendar-day-header.past {
  background: linear-gradient(135deg, rgba(20, 20, 20, 0.9), rgba(15, 15, 15, 0.9));
  opacity: 0.4;
  border-color: rgba(255, 255, 255, 0.05);
}

.calendar-day-name {
  font-size: 0.5rem;
  font-weight: 300;
  color: #f1c40f;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
  line-height: 1;
}

.calendar-day-date {
  font-size: 0.56rem;
  color: #e0e0e0;
  margin-top: 1px;
  line-height: 1;
}

/* Time slot labels (left column) - only for hour starts */
.time-slot-label {
  background: linear-gradient(135deg, rgba(40, 40, 40, 0.9), rgba(25, 25, 25, 0.9));
  border-top: 1px solid rgba(241, 196, 15, 0.3);
  border-bottom: none;
  border-left: none;
  border-right: none;
  padding: 6px 3px;
  text-align: center;
  font-size: 0.5rem;
  font-weight: 300;
  color: #f1c40f;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
  min-height: 25px;
}

/* Empty time slot labels for non-hour starts - completely hidden */
.time-slot-label-empty {
  display: none;
}

/* Time slot cells (day/hour intersections) - neutral background */
.time-slot-cell {
  background: linear-gradient(135deg, rgba(35, 35, 35, 0.8), rgba(25, 25, 25, 0.8));
  border-left: none;
  border-bottom: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1px;
  position: relative;
  transition: all 0.2s ease;
  min-height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.time-slot-cell:hover {
  border-color: rgba(241, 196, 15, 0.2);
}

.time-slot-cell.today {
  border-color: rgba(241, 196, 15, 0.2);
  border-left: 1px solid rgba(241, 196, 15, 0.2);
}

.time-slot-cell.past {
  opacity: 0.4;
  border-color: rgba(255, 255, 255, 0.05);
}

/* Time slot cells that are completely in the past */
.time-slot-cell.past-slot {
  background: linear-gradient(135deg, rgba(20, 20, 20, 0.9), rgba(15, 15, 15, 0.9)) !important;
  opacity: 0.3;
  border-color: rgba(255, 255, 255, 0.05) !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

/* Time slot cells that have some past 15-minute slots */
.time-slot-cell.partial-past {
  position: relative;
}

/* Add a gradient overlay to show past portion of partially past slots */
.time-slot-cell.partial-past::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--past-height, 0%);
  background: linear-gradient(135deg, rgba(20, 20, 20, 0.8), rgba(15, 15, 15, 0.8));
  opacity: 0.6;
  z-index: 1;
  pointer-events: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Ensure events in partially past slots appear above the overlay */
.time-slot-cell.partial-past .calendar-event {
  z-index: 15;
}

/* Events within time slots */
.time-slot-cell .calendar-event {
  background: linear-gradient(135deg, rgba(40, 40, 40, 0.9), rgba(30, 30, 30, 0.9));
  border: 1px solid rgba(241, 196, 15, 0.6);
  padding: 2px 3px;
  font-size: 0.52rem;
  line-height: 1.1;
  transition: all 0.2s ease;
  text-align: center;
  position: absolute;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

/* Main events (that start at this hour) - can span multiple hours with absolute height */
.time-slot-cell .calendar-event.main-event {
  position: absolute;
  min-height: 25px;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  /* Positioning is handled by inline styles from JavaScript for precise 15-minute slot positioning */
}

/* Continuation events (spanning through but not starting here) - minimal styling */
.time-slot-cell .calendar-event.continuation-event {
  border: none;
  opacity: 0.8;
  z-index: 5;
  position: absolute;
  /* Positioning is handled by inline styles from JavaScript */
  /* No generic background - only specific event type backgrounds */
}

.time-slot-cell .calendar-event.continuation-event .event-continuation {
  color: rgba(241, 196, 15, 0.8);
  font-size: 1rem;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.time-slot-cell .calendar-event.open-slot {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.8), rgba(56, 142, 60, 0.8));
  border-color: #4CAF50;
  cursor: default;
}

.time-slot-cell .calendar-event.open-slot.continuation-event {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.8), rgba(56, 142, 60, 0.8));
}

.time-slot-cell .calendar-event.open-slot:hover {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.8), rgba(56, 142, 60, 0.8));
  transform: scale(1.02);
  box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
}

.time-slot-cell .calendar-event.booked-slot {
  background: linear-gradient(135deg, rgba(244, 67, 54, 0.8), rgba(211, 47, 47, 0.8));
  border-color: #F44336;
}

.time-slot-cell .calendar-event.booked-slot.continuation-event {
  background: linear-gradient(135deg, rgba(244, 67, 54, 0.8), rgba(211, 47, 47, 0.8));
}

.time-slot-cell .calendar-event .event-title {
  color: #e0e0e0;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1;
  margin-bottom: 1px;
  font-size: 0.56rem;
}

.time-slot-cell .calendar-event .event-details {
  display: flex;
  flex-direction: column;
  gap: 1px;
  align-items: center;
}

.time-slot-cell .calendar-event .event-time-range {
  font-weight: 400;
  color: #f1c40f;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
  font-size: 0.52rem;
  line-height: 1;
  white-space: nowrap;
}

.booking-calendar-footer {
  padding: 12px 20px;
  background: linear-gradient(135deg, rgba(25, 25, 25, 0.9), rgba(15, 15, 15, 0.9));
  border-top: 1px solid rgba(241, 196, 15, 0.3);
}

.calendar-legend {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #e0e0e0;
}

.legend-color {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.legend-color.open-slot {
  background: #4CAF50;
}

.legend-color.booked-slot {
  background: #F44336;
}

/* Booking Modal Styles */
.booking-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  z-index: 200;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.booking-modal-backdrop.show {
  opacity: 1;
}

.booking-modal-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, rgba(40, 40, 40, 0.95), rgba(25, 25, 25, 0.95));
  border: 2px solid rgba(241, 196, 15, 0.6);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(241, 196, 15, 0.2);
  color: #e0e0e0;
  display: none;
  z-index: 201;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.9);
  transition: all 0.3s ease-in-out;
  max-width: 90vw;
  max-height: 90vh;
  min-width: 400px;
}

.booking-modal-container.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.booking-modal-content {
  display: flex;
  flex-direction: column;
  min-height: 300px;
}

.booking-modal-header {
  padding: 20px 25px 15px;
  border-bottom: 1px solid rgba(241, 196, 15, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(241, 196, 15, 0.1), rgba(243, 156, 18, 0.05));
}

.booking-modal-header h3 {
  margin: 0;
  color: #f1c40f;
  font-size: 1.4rem;
  font-weight: 300;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.8);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.booking-modal-close {
  background: none;
  border: none;
  color: #f1c40f;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.booking-modal-close:hover {
  background: rgba(241, 196, 15, 0.2);
  transform: rotate(90deg);
}

.booking-modal-body {
  padding: 25px;
  flex: 1;
}

.booking-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  color: #f1c40f;
  font-size: 0.9rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.form-group input,
.form-group select {
  background: linear-gradient(135deg, rgba(35, 35, 35, 0.9), rgba(25, 25, 25, 0.9));
  border: 2px solid rgba(241, 196, 15, 0.3);
  border-radius: 6px;
  padding: 12px 15px;
  color: #e0e0e0;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: #f1c40f;
  box-shadow: 0 0 8px rgba(241, 196, 15, 0.3);
  background: linear-gradient(135deg, rgba(45, 45, 45, 0.9), rgba(35, 35, 35, 0.9));
}

.form-group select option {
  background: #2a2a2a;
  color: #e0e0e0;
}

.booking-modal-footer {
  padding: 15px 25px 20px;
  border-top: 1px solid rgba(241, 196, 15, 0.3);
  display: flex;
  justify-content: flex-end;
  gap: 15px;
}

.booking-btn {
  padding: 12px 24px;
  border: 2px solid;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
}

.booking-btn.cancel {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.3);
  color: #e0e0e0;
}

.booking-btn.cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.booking-btn.submit {
  background: linear-gradient(135deg, rgba(241, 196, 15, 0.9), rgba(243, 156, 18, 0.9));
  border-color: #f1c40f;
  color: #1a1a1a;
  font-weight: 600;
}

.booking-btn.submit:hover:not(:disabled) {
  background: linear-gradient(135deg, #f1c40f, #f39c12);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(241, 196, 15, 0.4);
}

.booking-btn.submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Drag interaction styles */
.time-slot-cell.drag-start {
  background: linear-gradient(135deg, rgba(241, 196, 15, 0.2), rgba(243, 156, 18, 0.1)) !important;
  border-color: rgba(241, 196, 15, 0.6) !important;
}

.time-slot-cell.drag-over {
  background: linear-gradient(135deg, rgba(241, 196, 15, 0.15), rgba(243, 156, 18, 0.08)) !important;
}

/* Enhanced hover effect for bookable slots - exclude past slots */
.time-slot-cell:not(.past):not(.past-slot):not(.partial-past):hover {
  background: linear-gradient(135deg, rgba(241, 196, 15, 0.1), rgba(243, 156, 18, 0.05)) !important;
  border-color: rgba(241, 196, 15, 0.4) !important;
  cursor: pointer;
}

/* Success message styles */
.booking-success-message {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.95), rgba(56, 142, 60, 0.95));
  border: 2px solid #4CAF50;
  border-radius: 8px;
  padding: 15px 20px;
  color: white;
  z-index: 210;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease-in-out;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.booking-success-message.show {
  opacity: 1;
  transform: translateX(0);
}

.success-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.success-icon {
  font-size: 1.2rem;
  font-weight: bold;
}

.success-text {
  font-size: 1rem;
  font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .booking-calendar-container {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 1vw);
    max-width: none;
  }
  
  .booking-calendar-header {
    padding: 12px 15px;
  }
    .calendar-week-title {
    font-size: 1.1rem;
    letter-spacing: 2px;
  }
  
  .calendar-nav-btn {
    padding: 6px 10px;
    font-size: 1rem;
    min-width: 35px;
  }
  
  .calendar-day {
    min-height: 100px;
  }
  
  .calendar-day-header {
    padding: 6px 4px;
  }
    .calendar-day-name {
    font-size: 0.7rem;
    letter-spacing: 0.5px;
  }
  
  .calendar-day-date {
    font-size: 0.8rem;
  }
    .calendar-event {
    font-size: 0.75rem;
    padding: 3px 4px;
  }
  
  .calendar-legend {
    gap: 15px;
  }
  
  .legend-item {
    font-size: 0.75rem;
  }
  
  /* Responsive adjustments for demo watermark on tablet */
  .booking-calendar-container::before {
    font-size: 5rem;
    letter-spacing: 0.5rem;
  }
}

@media (max-width: 480px) {
  .booking-calendar-grid {
    gap: 4px;
    padding: 12px;
  }
  
  .calendar-day {
    min-height: 80px;
  }
  
  .calendar-day-header {
    padding: 4px 2px;
  }
    .calendar-day-name {
    font-size: 0.65rem;
    letter-spacing: 0.3px;
  }
  
  .calendar-day-date {
    font-size: 0.7rem;
  }
  
  .calendar-day-events {
    padding: 4px 2px;
    gap: 2px;
  }
    .calendar-event {
    font-size: 0.7rem;
    padding: 2px 3px;
  }
  
  .calendar-legend {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  
  .booking-modal-container {
    min-width: 300px;
    width: 95vw;
    margin: 0 2.5vw;
  }
  
  .booking-modal-header {
    padding: 15px 20px 10px;
  }
  
  .booking-modal-header h3 {
    font-size: 1.2rem;
    letter-spacing: 1px;
  }
  
  .booking-modal-body {
    padding: 20px;
  }
  
  .booking-modal-footer {
    padding: 10px 20px 15px;
    flex-direction: column;
  }
  
  .booking-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .booking-modal-container {
    min-width: 280px;
  }
  
  .booking-success-message {
    top: 10px;
    right: 10px;
    left: 10px;
    transform: translateY(-100%);
  }
  
  .booking-success-message.show {
    transform: translateY(0);
  }
  
  /* Responsive adjustments for demo watermark */
  .booking-calendar-container::before {
    font-size: 3rem;
    letter-spacing: 0.25rem;
  }
}
