/* booking.css */

/* Staff selection grid */
  .staff-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);   /* 3 columns on mobile */
    gap: 14px;
    padding: 4px 2px;
  }

  /* Individual card */
  .staff-card {
    min-width: 0;  /* important for CSS Grid – prevents overflow/squishing */
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    border-radius: 16px;
    padding: 10px 6px 12px;
    background: #ffffff;
    transition: all 0.2s ease;
    border: 2.5px solid transparent;          /* reserve space for outline */
    user-select: none;
    -webkit-tap-highlight-color: transparent;
  }

  /* Rounded-square image */
  .staff-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 14px;                      /* nice rounded square */
    display: block;
    background: #f0f0f0;
  }

  /* Special style for "Any staff" */
  .staff-image.any-staff {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f4ff;
    color: #4a6cf7;
  }

  /* Special style for staff without photo */
  .staff-image.staff-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #4a6cf7;
    color: #ffffff;
    font-size: 32px;
    font-weight: 600;
    border-radius: 14px;
    user-select: none;
    line-height: 1;
  }

  /* Name + ? button row */
  .staff-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    width: 100%;
  }

  .staff-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: calc(100% - 28px);   /* leave space for the button */
  }

  /* Small ? button */
  .staff-ai-btn {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid #c5c5c5;
    background: #f7f7f7;
    color: #666;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
  }

  .staff-ai-btn:active {
    background: #4a6cf7;
    border-color: #4a6cf7;
    color: white;
    transform: scale(0.92);  /* bounces ai button on selected image */
  }

  /* ===== Selected State ===== */
  .staff-card.selected {
    border-color: #4a6cf7;                    /* strong outline */
    background: #f0f4ff;                      /* light tint */
    box-shadow: 0 4px 12px rgba(74, 108, 247, 0.18);
  }

  .staff-card.selected .staff-name {
    color: #4a6cf7;
    font-weight: 600;
  }

  .staff-card.selected .staff-ai-btn {
    border-color: #4a6cf7;
    color: #4a6cf7;
    background-color: #eef2ff;
  }

  /* Optional: slightly larger on wider screens */
  @media (min-width: 400px) {
    .staff-grid {
      grid-template-columns: repeat(4, 1fr);
      gap: 16px;
    }
  }

/* Date label and booking hint */
  .date-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
  }

  .date-label-row label {
    margin: 0;
    flex-shrink: 0;
  }

  .booking-hint {
    margin: 0;
    font-size: 13px;
    line-height: 1.3;
    color: #b45309;
    text-align: right;
  }

/* Calendar flatpickr */
  .flatpickr-input,
  #datePicker {
    width: 100%;
    padding: 6px 8px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #fff;
    box-sizing: border-box;
    /* Hide the blinking cursor (caret) because manual typing is disabled */
    caret-color: transparent;
  }
  /* Safety for the calendar popup in LIFF webview */
  .flatpickr-calendar {
    z-index: 99999 !important;
  }
  /* Color highlight for individual dates */
  .flatpickr-day.flatpickr-disabled {
    color: #c8c8c8;
  }
  .flatpickr-day.flatpickr-disabled.day-shop-closed {
    background: #f8e8e8 !important;
    color: #b07070 !important;
    text-decoration: line-through;
  }
  .flatpickr-day.flatpickr-disabled.day-staff-off {
    background: #ececec !important;
    color: #9a9a9a !important;
  }

/* Calendar legend */
  .calendar-legend {
    display: flex;
    gap: 14px;
    margin-top: 8px;
    font-size: 12px;
    color: #666;
  }
  .legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  .legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
  }
  .legend-closed {
    background: #f8e8e8;
    text-decoration: line-through; /* optional; the text can just say 店休日 */
  }
  .legend-staff-off {
    background: #ececec;
  }

/* Confirmation Screen */
  #confirmationContent {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
    margin: 16px 0;
    line-height: 1.7;
  }
  #confirmationContent strong {
    color: #333;
  }

/* Accordion menu */
  .accordion-item {
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
  }
  .accordion-header {
    padding: 16px;
    background: #f8f8f8;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .accordion-content {
    padding: 4px 0;
  }
  .service-row {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid #f0f0f0;
  }
  .service-row:hover, .service-row:active {
    background: #f9f9f9;
  }
  .question-btn {
    width: 24px;
    height: 24px;
    border: 1px solid #999;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    flex-shrink: 0;
  }
  /* Modal Styles */
  .modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
  }
  .modal-content {
    background: #fff;
    width: 90%;
    max-width: 420px;
    border-radius: 12px;
    overflow: hidden;
  }
  .modal-header {
    padding: 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .modal-body {
    padding: 20px;
    line-height: 1.5;
    font-size: 15px;
  }
  .close-btn {
    font-size: 20px;
    cursor: pointer;
    color: #999;
  }
  .summary-bar {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #ddd;
    padding: 12px 16px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 100;
  }
  .next-btn {
    width: 100%;
    padding: 14px;
    margin-top: 8px;
    background: #ff6b9d;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
  }
  .next-btn:disabled {
    background: #ccc;
  }
