/* 
 * Minimal CSS for calendar grid components
 * All other styling via Tailwind CDN
 */

/* Global button cursor */
button {
  cursor: pointer;
}

/* Floating Pill Navigation Menu (Google-style) */
.text-tiny {
  font-size: 0.625rem;
}

.nav-floating {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  justify-content: center;
  padding: 1rem 0;
  background: linear-gradient(
    to bottom,
    rgba(249, 250, 251, 1) 0%,
    rgba(249, 250, 251, 0.95) 80%,
    rgba(249, 250, 251, 0) 100%
  );
}

.nav-pill {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.375rem;
  background-color: #ffffff;
  border-radius: 16px; /* Updated for multi-line */
  box-shadow: rgba(54, 64, 67, 0.3) 0px 1px 2px 0px,
    rgba(54, 64, 67, 0.15) 0px 1px 3px 1px;
    
  /* Wrap logic: Max width 660px, then wrap */
  max-width: 740px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%; /* Ensure it takes space up to max-width */
}

.nav-pill a {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #202124;
  text-decoration: none;
  border-radius: 9999px;
  transition: background-color 0.15s ease;
  white-space: nowrap;
  
  /* Layout behavior */
  flex: 1 1 auto; /* Allow items to fill space */
  justify-content: center;
  text-align: center;
  margin: 1px;
}

.nav-pill a:hover {
  background-color: #f1f3f4;
}

.nav-pill a.active {
  background-color: #e8f0fe;
  color: #1a73e8;
}

.nav-pill a.active:hover {
  background-color: #d2e3fc;
}

@media (max-width: 768px) {
  .nav-pill {
    /* overflow-x: auto;  <-- Disabled scrolling */ 
    /* max-width: calc(100vw - 2rem); */
    /* -webkit-overflow-scrolling: touch; */
    /* scrollbar-width: none; */
    border-radius: 16px;
  }

  .nav-pill::-webkit-scrollbar {
    display: none;
  }

  .nav-pill a {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }
}

/* Calendar Grid - can't easily replicate with inline Tailwind */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}

.day-name {
  font-weight: 600;
  text-align: center;
  color: #6b7280;
  font-size: 0.875rem;
  padding: 0.5rem;
}

.day {
  position: relative;
  padding: 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  min-height: 100px;
  transition: all 0.15s;
  font-size: 0.875rem;
}

.day-number {
  font-weight: 500;
  font-size: 0.875rem;
}

.day.empty {
  background-color: #f9fafb;
}

.day.today {
  box-shadow: 0 0 0 2px #6366f1;
}

.day.weekend {
  background-color: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}

.day.available {
  background-color: #ecfdf5;
  border-color: #a7f3d0;
  cursor: pointer;
}

.day.available:hover {
  background-color: #d1fae5;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.day.booked-own {
  background-color: #eff6ff;
  border-color: #bfdbfe;
  cursor: pointer;
}

.day.booked-own:hover {
  background-color: #dbeafe;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.day.booked-other {
  background-color: #fef2f2;
  border-color: #fecaca;
  cursor: not-allowed;
}

.day.booked-other.admin {
  cursor: pointer;
}

.day.booked-other.admin:hover {
  background-color: #fee2e2;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Pending bookings (not yet accepted) - Orange */
.day.booked-pending {
  background-color: #fff7ed;
  border-color: #fed7aa;
  cursor: pointer;
}

.day.booked-pending:hover {
  background-color: #ffedd5;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.day.booked-pending.admin {
  cursor: pointer;
}

.day.booked-pending.admin:hover {
  background-color: #ffedd5;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.day.holiday {
  background-color: #fffbeb;
  border-color: #fde68a;
  cursor: not-allowed;
}

.day.holiday.vacation {
  background-color: #e5e7eb;
  border-color: #d1d5db;
}

.holiday-name {
  font-size: 0.75rem;
  margin-top: 0.25rem;
  line-height: 1.25;
  color: #374151;
}

.booking-info {
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.booking-info > div {
  margin-top: 0.125rem;
}

/* Mobile: Hide Sundays only (Saturday is now bookable) */
@media (max-width: 900px) {
  .calendar-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .day-name:nth-child(7) {
    display: none;
  }

  .day.weekend {
    display: none;
  }

  .day {
    min-height: 120px;
  }
}

/* Navigation */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.calendar-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
}

#prev-month-btn,
#next-month-btn {
  padding: 0.5rem;
  border-radius: 9999px;
  color: #4b5563;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: none;
}

#prev-month-btn:hover,
#next-month-btn:hover {
  background-color: #f3f4f6;
  color: #111827;
}

/* Booking Table */
.booking-list-table {
  width: 100%;
  font-size: 0.875rem;
  border-collapse: collapse;
}

.booking-list-table th,
.booking-list-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #f3f4f6;
}

.booking-list-table th {
  background-color: #f9fafb;
  font-weight: 600;
  color: #6b7280;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.booking-list-table tr:hover td {
  background-color: #f9fafb;
}

/* Print Footer - hidden on screen, visible on print */
.print-footer {
  display: none;
}

/* Print */
@media print {
  body {
    background-color: #fff;
    color: #000;
  }

  header,
  #holiday-management,
  #calendar-container,
  #user-profile-container,
  #offers-section,
  #offers-above-calendar,
  #invoices-section,
  .dontprint,
  button {
    display: none !important;
  }

  #my-bookings-container {
    display: block !important;
  }

  .print-footer {
    display: block !important;
  }
}

/* Custom select for Safari/Cross-browser consistency */
.custom-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}
