/* ==============================
   BOOKINGS CALENDAR STYLING
   ============================== */

/* Table base */
.rbs-calendar-table {
    border-collapse: collapse;
    width: 100%;
    background: #fff;
    border: 1px solid #ddd;
    table-layout: fixed;
}

/* Header cells */
.rbs-calendar-table thead th {
    background: #f8f8f8;
    padding: 10px;
    font-weight: 600;
    text-align: center;
    font-size: 14px;
}

/* Day cells */
.rbs-calendar-table td {
    border: 1px solid #eee;
    vertical-align: top;
    height: 90px;
    padding: 6px;
    position: relative;
    transition: background 0.2s ease;
}

/* Day number */
.rbs-day-num {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

/* Badge */
.rbs-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    background: #2271b1;
    color: #fff;
    font-size: 10px;
    white-space: nowrap;
}

/* Days with bookings */
.rbs-has-bookings {
    background: #f0f7ff;
}

/* Closed days */
.rbs-closed {
    background: #ffefef !important;
    border: 1px solid #f5b5b5;
}

/* Hover effect */
.rbs-calendar-table td:hover {
    background: #f7f7f7;
}

/* Legend styling */
.rbs-cal-legend {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    vertical-align: middle;
    margin-right: 6px;
}

/* ==============================
   RESPONSIVE BREAKPOINTS
   ============================== */

/* Small devices: Stack days vertically */
@media (max-width: 768px) {
    .rbs-calendar-table,
    .rbs-calendar-table thead,
    .rbs-calendar-table tbody,
    .rbs-calendar-table th,
    .rbs-calendar-table td,
    .rbs-calendar-table tr {
        display: block;
        width: 100%;
    }

    .rbs-calendar-table thead {
        display: none;
    }

    .rbs-calendar-table tr {
        margin-bottom: 10px;
        border: 1px solid #ddd;
        border-radius: 6px;
        overflow: hidden;
    }

    .rbs-calendar-table td {
        height: auto;
        padding: 10px;
        border: none !important;
        border-bottom: 1px solid #eee !important;
    }

    .rbs-day-num {
        font-size: 16px;
        margin-bottom: 6px;
    }

    .rbs-badge {
        font-size: 13px;
    }
}

/* Extra small: make badges and text bigger for touch */
@media (max-width: 480px) {
    .rbs-day-num {
        font-size: 18px;
    }
    .rbs-badge {
        font-size: 14px;
        padding: 4px 10px;
    }
}

/* =========================================
   RBS — Admin Bookings Page Responsive UI
   ========================================= */

/* Page spacing & headings */
.wrap h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

/* Filter bar */
.wrap form[action="admin.php"][method="GET"],
.wrap form[method="GET"] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e3e3e3;
  border-radius: 8px;
  margin-bottom: 16px !important;
}

.wrap form[method="GET"] input[type="date"] {
  height: 36px;
  padding: 6px 10px;
}

/* Responsive table container */
.rbs-table-responsive {
  width: 100%;
  overflow-x: auto;              /* desktop safeguard for narrow viewports */
  -webkit-overflow-scrolling: touch;
}

/* Base table look */
.wp-list-table.widefat.fixed.striped {
  background: #fff;
  border: 1px solid #e3e3e3;
  border-radius: 8px;
  overflow: hidden;              /* keeps rounded corners */
}

.wp-list-table thead th {
  background: #f8f9fb;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.wp-list-table th, .wp-list-table td {
  padding: 10px 12px;
}

/* Actions column */
.wp-list-table td[data-label="Actions"] .button {
  margin-right: 6px;
  margin-bottom: 6px;
}

/* Success/error notices spacing inside page */
.notice {
  margin: 12px 0;
}

/* ------------------------------
   Mobile stacked table (≤ 782px)
   ------------------------------ */
@media (max-width: 782px) {
  /* Hide table header and transform rows to cards */
  .wp-list-table thead {
    display: none;
  }

  .wp-list-table,
  .wp-list-table tbody,
  .wp-list-table tr,
  .wp-list-table td {
    display: block;
    width: 100%;
  }

  .wp-list-table tr {
    border: 1px solid #e3e3e3;
    border-radius: 10px;
    background: #fff;
    margin-bottom: 12px;
    box-shadow: 0 1px 0 rgba(0,0,0,0.02);
    overflow: hidden;
  }

  .wp-list-table td {
    border: none;
    border-bottom: 1px solid #f1f1f1;
    padding: 10px 12px 10px 120px; /* room for label on the left */
    position: relative;
    min-height: 44px;              /* touch target */
  }

  .wp-list-table td:last-child {
    border-bottom: none;
  }

  /* Use data-label as the left label */
  .wp-list-table td::before {
    content: attr(data-label);
    position: absolute;
    left: 12px;
    top: 10px;
    width: 96px;
    font-weight: 600;
    color: #555d66;
    font-size: 12px;
    line-height: 1.3;
    text-transform: none;
    white-space: normal;
  }

  /* Actions buttons: full-width rows feel nicer on mobile */
  .wp-list-table td[data-label="Actions"] .button {
    display: inline-block;
    width: auto;
    min-width: 44%;
    text-align: center;
  }

  .rbs-table-responsive {
    overflow-x: visible; /* no horizontal scroll needed in stacked mode */
  }
}

/* ------------------------------
   Forms (Edit & Manual Add)
   ------------------------------ */
.wrap form input[type="text"],
.wrap form input[type="email"],
.wrap form input[type="number"],
.wrap form input[type="date"],
.wrap form select {
  width: 100%;
  max-width: 520px;
  height: 38px;
  padding: 6px 10px;
  border: 1px solid #dcdcde;
  border-radius: 6px;
  background: #fff;
  box-sizing: border-box;
}

.wrap form select {
  height: 40px;
}

.wrap form .regular-text {
  width: 100%;
  max-width: 520px;
}

/* Space form inputs nicely */
.wrap form input,
.wrap form select {
  margin: 6px 8px 6px 0;
}

/* Submit buttons */
.wrap form .button.button-primary,
.wrap form input[type="submit"].button-primary,
.wrap form .btn.btn-primary {
  padding: 8px 14px;
  border-radius: 8px;
}

/* Group the Edit/Manual sections visually */
.wrap h2 {
  margin-top: 22px;
  margin-bottom: 10px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
}

/* Make the Edit form widgets align better on small screens */
@media (max-width: 782px) {
  .wrap form input,
  .wrap form select {
    max-width: 100%;
  }
}

/* ------------------------------
   Utilities for status emphasis
   ------------------------------ */
.rbs-pill {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 999px;
  background: #eef2ff;
  color: #1e40af;
  vertical-align: middle;
}

/* Time display (g:i A) */
.rbs-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  letter-spacing: .2px;
}

/* Phone/email cells can wrap nicely on mobile */
@media (max-width: 782px) {
  .wp-list-table td[data-label="Email"],
  .wp-list-table td[data-label="Phone"] {
    word-break: break-word;
  }
}


/* ==============================
   Toggle Switch Styling
   ============================== */
/* Toggle Switch: checked = CLOSED (red), unchecked = OPEN (green) */
.rbs-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
  vertical-align: middle;
}
.rbs-switch input { opacity: 0; width: 0; height: 0; }

.rbs-slider {
  position: absolute; inset: 0;
  cursor: pointer;
  border-radius: 34px;
  background-color: #4CAF50;            /* OPEN (unchecked) = green */
  transition: background-color .25s, box-shadow .25s;
}
.rbs-slider::before {
  content: "";
  position: absolute;
  left: 3px; bottom: 3px;
  width: 16px; height: 16px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
  transition: transform .25s;
}

/* CHECKED = CLOSED */
.rbs-switch input:checked + .rbs-slider {
  background-color: #e74c3c;            /* CLOSED = red */
}
.rbs-switch input:checked + .rbs-slider::before {
  transform: translateX(22px);
}

/* Focus ring (keyboard accessibility) */
.rbs-switch input:focus + .rbs-slider { box-shadow: 0 0 0 2px rgba(34,113,177,.35); }

/* Slightly larger on small screens */
@media (max-width: 600px) {
  .rbs-switch { width: 50px; height: 26px; }
  .rbs-slider::before { width: 20px; height: 20px; }
  .rbs-switch input:checked + .rbs-slider::before { transform: translateX(24px); }
}


/* Mobile accordion — hidden on desktop */
.rbs-accordion-list { display: none; }

/* Card container */
.rbs-acc-card {
  border: 1px solid #e3e3e3;
  border-radius: 10px;
  background: #fff;
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}

/* Header button */
.rbs-acc-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: #f8f9fb;
  border: none;
  text-align: left;
  cursor: pointer;
  position: relative;
}

.rbs-acc-name {
  font-weight: 600;
  font-size: 15px;
  color: #1d2327;
}

.rbs-acc-meta {
  display: flex;
  gap: 6px;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.rbs-pill {
  display: inline-block;
  padding: 2px 8px;
  font-size: 12px;
  border-radius: 999px;
  background: #eef2ff;
  color: #1e40af;
}

/* Chevron */
.rbs-acc-chevron {
  width: 10px; height: 10px;
  border-right: 2px solid #777;
  border-bottom: 2px solid #777;
  transform: rotate(45deg);
  margin-left: 8px;
  flex: none;
  transition: transform .2s;
}
.rbs-acc-open .rbs-acc-chevron { transform: rotate(-135deg); }

/* Body */
.rbs-acc-body {
  padding: 12px 14px;
  border-top: 1px solid #eee;
}
.rbs-acc-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 10px;
  padding: 6px 0;
  align-items: start;
}
.rbs-acc-row strong {
  color: #555d66;
  font-size: 12px;
  line-height: 1.4;
}
.rbs-acc-actions {
  margin-top: 10px;
}
.rbs-acc-actions .button {
  margin-right: 6px;
  margin-bottom: 6px;
}

/* Responsive behavior */
@media (max-width: 782px) {
  /* Hide desktop table; show accordion */
  .rbs-table-responsive { display: none !important; }
  .rbs-accordion-list { display: block !important; }

  .rbs-acc-header { padding: 14px 16px; }
  .rbs-acc-name { font-size: 16px; }
  .rbs-acc-row { grid-template-columns: 100px 1fr; }
}

@media (max-width: 480px) {
  .rbs-acc-row { grid-template-columns: 90px 1fr; }
  .rbs-pill { font-size: 11px; }
}
