/**
 * White's Lane Manager - Frontend Booking Calendar Styles
 */

/* ================================
   Modern Design Variables (Image Match)
   ================================ */
:root {
  /* Core Colors */
  --wlm-bg-page: #f9fafb;
  --wlm-bg-card: #ffffff;

  --wlm-primary-text: #111827; /* Dark Gray/Black for Headings */
  --wlm-secondary-text: #6b7280; /* Gray for subtitles */

  --wlm-border-color: #000000; /* Black border as per request for better visibility */
  --wlm-border-radius: 12px;

  /* Selected States */
  --wlm-selected-lane-bg: #ffe4e6; /* Light Pink */
  --wlm-selected-lane-border: #000000; /* Solid Black */

  --wlm-selected-date-bg: #000000; /* Solid Black */
  --wlm-selected-date-text: #ffffff; /* White */

  --wlm-badge-membership-bg: #ffe4e6;
  --wlm-badge-membership-text: #991b1b;

  --wlm-shadow-card:
    0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --wlm-transition: all 0.2s ease;
}

/* ================================
   Base Wrapper
   ================================ */
.wlm-booking-wrapper {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 24px;
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  color: var(--wlm-primary-text);
}

/* ================================
   Header Bar (Flex Layout)
   ================================ */
.wlm-top-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 20px;
}

.wlm-page-title h2 {
  font-size: 32px;
  font-weight: 800;
  color: #000;
  margin: 0;
  letter-spacing: -0.5px;
}

.wlm-header-info-grid {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* User Status (Right Side Info) */
.wlm-user-status {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.wlm-status-label {
  font-weight: 600;
  color: #64748b; /* Blue-ish Gray */
}

.wlm-badge {
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}

.wlm-badge.membership {
  background: var(--wlm-badge-membership-bg);
  color: var(--wlm-badge-membership-text);
}

.wlm-remaining {
  color: #64748b;
  font-weight: 500;
}

/* ================================
   Main Content Containers
   ================================ */
.wlm-section {
  background: var(--wlm-bg-card);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--wlm-shadow-card);
  border: none; /* Clean card look */
}

.wlm-section h3 {
  font-size: 18px;
  font-weight: 700;
  color: #000;
  margin: 0 0 24px 0;
}

/* ================================
   Lane Selection (Grid)
   ================================ */
.wlm-lanes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.wlm-lane-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--wlm-border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: var(--wlm-transition);
  position: relative;
}

/* Unselected Hover */
.wlm-lane-card:hover {
  border-color: #d1d5db;
  transform: translateY(-2px);
}

/* Selected State - EXACT MATCH */
.wlm-lane-card.selected {
  background-color: var(--wlm-selected-lane-bg); /* Pink */
  border: 2px solid var(--wlm-selected-lane-border); /* Black */
  transform: none; /* Keep stable */
}

/* Lane Icon */
.lane-icon {
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  /* Remove colored background circle if image doesn't show it clearly, 
     but keeping a subtle one helps visual hierarchy. 
     Image shows a bowling icon. Let's keep it simple. */
  background: transparent;
}

/* Icon image replacement if needed, but text emoji for now */
.wlm-lane-card .lane-icon {
  font-size: 40px; /* Larger icon */
}

.lane-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lane-name {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
}

.lane-duration {
  font-size: 13px;
  color: #6b7280;
}

/* ================================
   Date Selection
   ================================ */
.wlm-dates-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}

.wlm-date-card {
  flex-shrink: 0;
  width: 80px;
  height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--wlm-border-color);
  background: #fff;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--wlm-transition);
}

.wlm-date-card:hover {
  border-color: #9ca3af;
}

/* Selected Date - EXACT MATCH */
.wlm-date-card.selected {
  background: var(--wlm-selected-date-bg); /* Black */
  color: var(--wlm-selected-date-text); /* White */
  border-color: var(--wlm-selected-date-bg);
}

.wlm-date-card .date-weekday {
  font-size: 11px;
  text-transform: uppercase;
  color: #6b7280;
  font-weight: 600;
  margin-bottom: 4px;
}

.wlm-date-card.selected .date-weekday {
  color: rgba(255, 255, 255, 0.8);
}

.wlm-date-card .date-day {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.wlm-date-card .date-month {
  font-size: 12px;
  font-weight: 500;
  color: #4b5563;
}

.wlm-date-card.selected .date-month {
  color: rgba(255, 255, 255, 0.9);
}

/* Hide the "slots available" pill for cleaner look if desired, or style it minimal */
.wlm-date-card .date-slots {
  display: none; /* Hiding to match clean image look */
}

/* ================================
   Time Slots (Keeping clean grid)
   ================================ */
.wlm-slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
}

.wlm-slot {
  padding: 12px;
  text-align: center;
  border: 1px solid var(--wlm-border-color);
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
  font-weight: 600;
  font-size: 14px;
  color: #374151;
}

.wlm-slot:hover:not(.unavailable) {
  border-color: #000;
}

.wlm-slot.selected {
  background: #000;
  color: #fff;
  border-color: #000;
}

.wlm-slot.unavailable {
  background: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
  border: 1px solid transparent;
}

/* ================================
   Summary & Buttons
   ================================ */
.wlm-summary {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--wlm-shadow-card);
  margin: 24px auto; /* Centered */
  max-width: 700px; /* Reduced width */
}

.wlm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.wlm-btn-primary {
  background: #000000; /* Black */
  color: #fff;
  text-decoration: none;
}

.wlm-btn-primary:hover {
  background: #dc2626; /* Red */
  color: #fff;
}

/* Secondary Button (Added for My Bookings) */
.wlm-btn-secondary {
  background: #fff;
  color: var(--wlm-primary-text);
  border: 1px solid var(--wlm-border-color);
}

.wlm-btn-secondary:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

/* Danger Button (Added for My Bookings) */
.wlm-btn-danger {
  background: #fee2e2;
  color: #dc2626;
}

.wlm-btn-danger:hover {
  background: #fecaca;
}

.wlm-btn-lg {
  width: 100%;
  padding: 16px;
  font-size: 18px;
  margin-top: 16px;
}

/* ================================
   Modals & States (Preserved & Restored)
   ================================ */
.wlm-login-required,
.wlm-no-lanes {
  text-align: center;
  padding: 60px 20px;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--wlm-shadow-card);
}

/* Modal Overlays (Alert & Subscription) */
.wlm-alert-modal,
.wlm-subscription-modal {
  display: none; /* Hidden by default */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.wlm-alert-modal.active,
.wlm-subscription-modal.active {
  display: flex;
}

/* Modal Boxes */
.wlm-alert-box,
.wlm-subscription-box {
  background: #fff;
  border-radius: 12px;
  padding: 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center; /* Center text as per image */
}

.wlm-alert-box h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #000;
}

.wlm-alert-box p {
  color: #374151;
  margin-bottom: 24px;
  font-size: 15px;
  line-height: 1.5;
}

/* Modal Button - Black as per image */
.wlm-alert-box .wlm-btn {
  background: #000000;
  color: #ffffff;
  width: 100%;
  justify-content: center;
}

.wlm-alert-box .wlm-btn:hover {
  background: #1f2937;
}

.wlm-alert-box h3,
.wlm-subscription-box h3 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 20px;
  color: #111827;
}

/* Subscription List */
.wlm-subscription-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.wlm-subscription-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--wlm-border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
}

.wlm-subscription-card:hover {
  border-color: #9ca3af;
  background: #f9fafb;
}

.wlm-subscription-card.active-selection {
  background-color: #f0fdf4;
  border-color: #22c55e;
}

.wlm-sub-icon {
  font-size: 24px;
}

.wlm-sub-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wlm-sub-name {
  font-weight: 700;
  color: #111827;
}

.wlm-sub-meta {
  font-size: 13px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wlm-sub-badge {
  background: #e5e7eb;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

/* Summary Items */
.wlm-summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 15px;
}

.wlm-summary-item:last-of-type {
  border-bottom: none;
}

.wlm-summary-item .label {
  color: #6b7280;
  font-weight: 500;
}

.wlm-summary-item .value {
  color: #111827;
  font-weight: 600;
  text-align: right;
}

.wlm-summary-note {
  background: #fff7ed;
  color: #c2410c;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-top: 8px;
}

/* Loading Overlay */
.wlm-loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  z-index: 2000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Hide loading text as requested */
.wlm-loading span {
  display: none;
}

.wlm-loading.active {
  display: flex;
}

/* Responsive */
@media (max-width: 768px) {
  .wlm-top-header-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .wlm-header-info-grid {
    width: 100%;
    flex-direction: column; /* Stack items vertically */
    align-items: flex-start;
    gap: 12px;
  }

  /* Improved User Status for Mobile */
  .wlm-user-status {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
    background: #f8fafc; /* Light background to separate */
    padding: 12px;
    border-radius: 8px;
  }

  .wlm-status-label {
    font-size: 13px;
    margin-bottom: 4px;
  }

  .wlm-lanes-grid {
    grid-template-columns: 1fr;
  }

  .wlm-lane-card {
    padding: 16px; /* Reduce padding */
  }
}

/* ================================
   My Bookings Page Styles
   ================================ */

.wlm-bookings-page {
  max-width: 900px;
  margin: 0 auto;
}

.wlm-bookings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.wlm-bookings-header h2 {
  font-size: 28px;
  font-weight: 800;
  color: var(--wlm-primary-text);
  margin: 0;
  letter-spacing: -0.5px;
}

/* Tabs */
.wlm-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  background: #e5e7eb; /* Light gray background for tab pill container */
  padding: 4px;
  border-radius: 12px;
  width: fit-content;
}

.wlm-tab {
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  background: transparent;
  border: none;
  color: var(--wlm-secondary-text);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wlm-tab:hover {
  color: var(--wlm-primary-text);
}

.wlm-tab.active {
  background: #fff;
  color: var(--wlm-primary-text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.wlm-count {
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
}

.wlm-tab.active .wlm-count {
  background: #f3f4f6; /* Keep it subtle */
  color: var(--wlm-primary-text);
}

.wlm-tab-content {
  display: none;
}

.wlm-tab-content.active {
  display: block;
}

/* Booking List */
.wlm-bookings-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wlm-booking-card {
  background: var(--wlm-bg-card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--wlm-shadow-card);
  display: flex;
  align-items: center;
  gap: 24px;
  border: 1px solid transparent;
  transition: var(--wlm-transition);
}

.wlm-booking-card:hover {
  border-color: var(--wlm-border-color);
  transform: translateY(-2px);
}

.wlm-booking-card.past {
  opacity: 0.8;
  background: #f9fafb;
  box-shadow: none;
  border: 1px solid var(--wlm-border-color);
}

/* Date Badge */
.booking-date-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border-radius: 12px;
  min-width: 70px;
  height: 70px;
  padding: 8px;
}

.booking-date-badge .date-day {
  font-size: 24px;
  font-weight: 800;
  color: var(--wlm-primary-text);
  line-height: 1;
}

.booking-date-badge .date-month {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--wlm-secondary-text);
}

.booking-date-badge .date-weekday {
  font-size: 11px;
  color: var(--wlm-secondary-text);
}

/* Details */
.booking-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.booking-details h4 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--wlm-primary-text);
}

.booking-time {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--wlm-secondary-text);
  font-size: 14px;
  font-weight: 500;
}

.booking-type .type-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: #e0f2fe;
  color: #0369a1;
}

/* Actions */
.booking-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wlm-expired-badge {
  padding: 6px 12px;
  background: #f3f4f6;
  color: #9ca3af;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
}

.wlm-no-cancel {
  font-size: 13px;
  color: #ef4444;
  font-weight: 500;
}

/* Empty State */
.wlm-empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--wlm-bg-card);
  border-radius: 16px;
  box-shadow: var(--wlm-shadow-card);
}

.wlm-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.wlm-empty-state h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--wlm-primary-text);
  margin: 0 0 8px 0;
}

.wlm-empty-state p {
  color: var(--wlm-secondary-text);
  margin-bottom: 24px;
}

/* QR Modal */
.wlm-qr-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.wlm-qr-modal.active {
  display: flex;
}

.wlm-qr-modal-content {
  background: #fff;
  padding: 40px;
  border-radius: 24px;
  text-align: center;
  max-width: 400px;
  width: 100%;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.wlm-qr-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #f3f4f6;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  transition: all 0.2s;
}

.wlm-qr-close:hover {
  background: #e5e7eb;
  color: #111827;
}

.wlm-qr-code img {
  max-width: 100%;
  height: auto;
  margin: 20px 0;
}

/* Responsive for My Bookings */
@media (max-width: 768px) {
  /* Header adjustments */
  .wlm-bookings-header {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .wlm-bookings-header .wlm-btn {
    width: 100%;
  }

  /* Card adjustments */
  .wlm-booking-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 16px; /* Reduce padding */
  }

  .booking-date-badge {
    flex-direction: row;
    width: 100%;
    height: auto;
    padding: 10px 16px;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
  }

  .booking-date-badge .date-day {
    font-size: 20px;
    margin-bottom: 0;
  }

  .booking-date-badge .date-month {
    font-size: 14px;
  }

  .booking-details {
    width: 100%;
  }

  .booking-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid #f3f4f6;
    padding-top: 16px;
  }

  .booking-actions .wlm-btn {
    flex: 1; /* Buttons share width */
    justify-content: center;
    min-width: 120px;
    padding: 10px 16px;
  }

  /* Status text placement */
  .wlm-no-cancel {
    width: 100%;
    text-align: center;
    margin-bottom: 8px;
    display: block;
    order: -1; /* Move above buttons */
  }
}

/* ================================
   Details Modal Styles
   ================================ */
.wlm-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.wlm-modal.active {
  display: flex;
}

.wlm-modal-content {
  background: #fff;
  padding: 32px;
  border-radius: 24px;
  width: 100%;
  max-width: 500px;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: wlmModalSlideUp 0.3s ease-out;
}

@keyframes wlmModalSlideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.wlm-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #f3f4f6;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  transition: all 0.2s;
}

.wlm-modal-close:hover {
  background: #e5e7eb;
  color: #111827;
}

.wlm-modal-content h3 {
  margin: 0 0 24px 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--wlm-primary-text);
  text-align: center;
}

/* Details Grid Styles */
.wlm-details-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.wlm-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid #f3f4f6;
}

.wlm-detail-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.wlm-detail-label {
  font-weight: 500;
  color: var(--wlm-secondary-text);
  font-size: 15px;
}

.wlm-detail-value {
  font-weight: 600;
  color: var(--wlm-primary-text);
  font-size: 15px;
  text-align: right;
}

/* Status Colors */
.wlm-detail-value.status-completed {
  color: #059669;
}
.wlm-detail-value.status-cancelled {
  color: #dc2626;
}
.wlm-detail-value.status-pending {
  color: #d97706;
}
