/* ============================================================
   LBI Mikes Calendar System — Plugin CSS v4.0
   Self-contained: no WPCode dependency for calendar styles
   ============================================================ */

/* ===== MODE TABS ===== */
.mode-tabs {
  max-width: 1100px; margin: 20px auto 0; padding: 0 20px;
  display: flex; gap: 0; border-bottom: 2px solid #E5E7EB;
}
.mode-tab {
  padding: 12px 28px; font-size: 0.95rem; font-weight: 600; cursor: pointer;
  border: none; background: none; color: #6B7280;
  border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all 0.2s;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
.mode-tab.active { color: #1B3A5C; border-bottom-color: #D4A843; }
.mode-tab:hover { color: #1B3A5C; }

/* ===== MAIN CONTAINER ===== */
.calendar-container {
  max-width: 1100px; margin: 20px auto; padding: 0 20px;
  display: grid; grid-template-columns: 1fr 360px; gap: 24px;
}
@media (max-width: 860px) { .calendar-container { grid-template-columns: 1fr; } }

/* ===== CALENDAR CARD ===== */
.cal-card {
  background: white; border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  padding: 24px; overflow: hidden;
}
.cal-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;
}
.cal-header h2 { font-family: 'Playfair Display', Georgia, serif; font-size: 1.4rem; color: #1B3A5C; margin: 0; }
.cal-nav { display: flex; gap: 8px; }
.cal-nav button {
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid #2E86AB;
  background: white; color: #2E86AB; font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s;
}
.cal-nav button:hover { background: #2E86AB; color: white; }

/* ===== WEEKDAY HEADERS ===== */
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr); text-align: center;
  font-size: 0.75rem; font-weight: 700; color: #6B7280; text-transform: uppercase;
  margin-bottom: 4px; letter-spacing: 1px;
}

/* ===== CALENDAR GRID ===== */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }

/* ===== DAY CELLS ===== */
.cal-day {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; border-radius: 8px; cursor: pointer; position: relative;
  font-size: 0.9rem; font-weight: 500; transition: all 0.15s; border: 2px solid transparent;
  min-height: 62px; padding: 2px;
}
.cal-day:hover:not(.booked):not(.empty):not(.past) { border-color: #2E86AB; background: #EBF5FB; }
.cal-day.empty { cursor: default; }
.cal-day.past { color: #ccc; cursor: not-allowed; }
.cal-day.today { font-weight: 700; border-color: #D4A843; }
.cal-day.booked { background: #FEE2E2; color: #991B1B; cursor: not-allowed; text-decoration: line-through; }
.cal-day.check-in { background: linear-gradient(135deg, #FEE2E2 50%, #D1FAE5 50%); color: #2D2D2D; cursor: pointer; text-decoration: none; }
.cal-day.check-out-day { background: linear-gradient(135deg, #D1FAE5 50%, #FEE2E2 50%); color: #2D2D2D; cursor: pointer; text-decoration: none; }
.cal-day.selected-start { background: #2E86AB; color: white; border-color: #2E86AB; }
.cal-day.selected-end { background: #2E86AB; color: white; border-color: #2E86AB; }
.cal-day.in-range { background: #DBEAFE; color: #1B3A5C; }
.cal-day .rate { font-size: 0.6rem; color: #059669; font-weight: 600; margin-top: 1px; }
.cal-day.booked .rate { color: #991B1B; }
.cal-day.selected-start .rate, .cal-day.selected-end .rate, .cal-day.in-range .rate { color: inherit; }
.cal-day .min-badge {
  position: absolute; top: 1px; right: 2px; font-size: 0.5rem; background: #D4A843;
  color: white; border-radius: 3px; padding: 0 3px; font-weight: 700; line-height: 1.4;
}

/* ===== LEGEND ===== */
.cal-legend {
  display: flex; gap: 16px; margin-top: 14px; flex-wrap: wrap; font-size: 0.78rem; color: #6B7280;
}
.cal-legend span { display: flex; align-items: center; gap: 5px; }
.legend-box { width: 16px; height: 16px; border-radius: 4px; display: inline-block; }

/* ===== SIDEBAR / QUOTE CARD ===== */
.sidebar-card {
  background: white; border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  padding: 24px; height: fit-content;
}
.sidebar-card h3 {
  font-family: 'Playfair Display', Georgia, serif; font-size: 1.2rem; color: #1B3A5C;
  margin-bottom: 16px; padding-bottom: 10px; border-bottom: 2px solid #D4A843;
}
.quote-row {
  display: flex; justify-content: space-between; padding: 8px 0;
  font-size: 0.92rem; border-bottom: 1px solid #f3f3f3;
}
.quote-row.total { font-weight: 700; font-size: 1.05rem; border-top: 2px solid #1B3A5C; border-bottom: none; margin-top: 8px; padding-top: 12px; color: #1B3A5C; }
.quote-row .label { color: #6B7280; }
.quote-row.total .label { color: #1B3A5C; }
.no-dates { text-align: center; color: #6B7280; padding: 30px 0; font-size: 0.95rem; }

/* ===== BOOK / QUOTE BUTTONS ===== */
.btn-book {
  width: 100%; padding: 14px; margin-top: 16px; border: none; border-radius: 8px;
  background: #E07A5F; color: white; font-size: 1.05rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s; font-family: 'Inter', sans-serif;
}
.btn-book:hover { background: #C96A50; transform: translateY(-1px); }
.btn-book:disabled { background: #ccc; cursor: not-allowed; transform: none; }
.btn-quote {
  width: 100%; padding: 12px; margin-top: 8px; border: 2px solid #2E86AB;
  border-radius: 8px; background: white; color: #2E86AB; font-size: 0.95rem;
  font-weight: 600; cursor: pointer; transition: all 0.2s; font-family: 'Inter', sans-serif;
}
.btn-quote:hover { background: #2E86AB; color: white; }

/* ===== ADMIN PANEL ===== */
.admin-panel { display: none; max-width: 1100px; margin: 20px auto; padding: 0 20px; }
.admin-panel.active { display: block; }
.admin-card {
  background: white; border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  padding: 24px; margin-bottom: 20px;
}
.admin-card h3 {
  font-family: 'Playfair Display', Georgia, serif; font-size: 1.15rem; color: #1B3A5C;
  margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid #D4A843;
}

/* Rate grid */
.rate-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-bottom: 20px;
}
.rate-day {
  text-align: center; padding: 10px 4px; background: #f9fafb; border-radius: 8px; border: 1px solid #E5E7EB;
}
.rate-day label { display: block; font-size: 0.75rem; font-weight: 700; color: #1B3A5C; margin-bottom: 6px; text-transform: uppercase; }
.rate-day input {
  width: 100%; text-align: center; padding: 8px 2px; border: 2px solid #E5E7EB;
  border-radius: 6px; font-size: 0.95rem; font-weight: 600; color: #2D2D2D;
  font-family: 'Inter', sans-serif; box-sizing: border-box;
}
.rate-day input:focus { border-color: #2E86AB; outline: none; }

/* Min stay grid */
.min-stay-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-bottom: 20px;
}
.min-stay-day { text-align: center; padding: 10px 4px; background: #f9fafb; border-radius: 8px; border: 1px solid #E5E7EB; }
.min-stay-day label { display: block; font-size: 0.75rem; font-weight: 700; color: #1B3A5C; margin-bottom: 6px; text-transform: uppercase; }
.min-stay-day select {
  width: 100%; text-align: center; padding: 8px 2px; border: 2px solid #E5E7EB;
  border-radius: 6px; font-size: 0.9rem; font-weight: 600; color: #2D2D2D;
  font-family: 'Inter', sans-serif; background: white;
}

/* Check-in / check-out day toggles */
.checkin-checkout-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-bottom: 20px;
}
.dow-toggle {
  text-align: center; padding: 12px 4px; border-radius: 8px; border: 2px solid #E5E7EB;
  cursor: pointer; transition: all 0.2s; background: #f9fafb;
}
.dow-toggle.active { background: #2E86AB; color: white; border-color: #2E86AB; }
.dow-toggle label { display: block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; cursor: pointer; }

/* Season override rows */
.season-row {
  display: grid; grid-template-columns: 120px 120px 1fr 100px 40px; gap: 10px;
  align-items: center; margin-bottom: 10px; padding: 10px; background: #f9fafb;
  border-radius: 8px;
}
.season-row input, .season-row select {
  padding: 8px; border: 2px solid #E5E7EB; border-radius: 6px;
  font-family: 'Inter', sans-serif; font-size: 0.9rem;
}
.season-row input:focus { border-color: #2E86AB; outline: none; }
.btn-add-season {
  padding: 10px 20px; border: 2px dashed #2E86AB; background: none;
  color: #2E86AB; border-radius: 8px; cursor: pointer; font-weight: 600;
  font-family: 'Inter', sans-serif; margin-top: 8px;
}
.btn-remove { background: none; border: none; color: #EF4444; font-size: 1.2rem; cursor: pointer; font-weight: 700; }

/* Save / reset buttons */
.btn-save {
  padding: 12px 32px; background: #059669; color: white; border: none;
  border-radius: 8px; font-size: 1rem; font-weight: 700; cursor: pointer;
  font-family: 'Inter', sans-serif; margin-top: 10px;
}
.btn-save:hover { background: #047857; }

/* iCal rows */
.ical-input-row { display: flex; gap: 10px; margin-bottom: 10px; }
.ical-input-row input { flex: 1; padding: 10px; border: 2px solid #E5E7EB; border-radius: 6px; font-size: 0.9rem; font-family: 'Inter', sans-serif; }
.ical-input-row button {
  padding: 10px 20px; background: #2E86AB; color: white; border: none;
  border-radius: 6px; font-weight: 600; cursor: pointer; font-family: 'Inter', sans-serif; white-space: nowrap;
}

/* Seasonal multi-row overrides */
.season-multi-row {
  margin-bottom: 14px; padding: 14px; background: #f9fafb;
  border-radius: 8px; border: 1px solid #E5E7EB;
}
.season-multi-header {
  display: grid; grid-template-columns: 120px 120px 1fr 40px; gap: 10px;
  align-items: center; margin-bottom: 10px;
}
.season-multi-header input, .season-multi-header select {
  padding: 8px; border: 2px solid #E5E7EB; border-radius: 6px;
  font-family: 'Inter', sans-serif; font-size: 0.9rem;
}
.season-multi-header input:focus { border-color: #2E86AB; outline: none; }
.season-dow-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px;
}
.season-dow-item {
  text-align: center; padding: 6px 2px; background: white; border-radius: 6px;
  border: 1px solid #E5E7EB;
}
.season-dow-item label {
  display: block; font-size: 0.7rem; font-weight: 700; color: #1B3A5C;
  margin-bottom: 4px; text-transform: uppercase;
}
.season-dow-item select {
  width: 100%; text-align: center; padding: 4px 2px; border: 1px solid #E5E7EB;
  border-radius: 4px; font-size: 0.8rem; font-weight: 600; color: #2D2D2D;
  font-family: 'Inter', sans-serif; background: white;
}
.season-dow-toggle {
  text-align: center; padding: 8px 2px; border-radius: 6px;
  border: 2px solid #E5E7EB; cursor: pointer; transition: all 0.2s;
  background: white;
}
.season-dow-toggle.active {
  background: #2E86AB; color: white; border-color: #2E86AB;
}
.season-dow-toggle label {
  display: block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; cursor: pointer;
}
.btn-add-season-multi {
  padding: 10px 20px; border: 2px dashed #2E86AB; background: none;
  color: #2E86AB; border-radius: 8px; cursor: pointer; font-weight: 600;
  font-family: 'Inter', sans-serif; margin-top: 8px;
}
.btn-add-booking {
  padding: 10px 20px; border: 2px dashed #2E86AB; background: none;
  color: #2E86AB; border-radius: 8px; cursor: pointer; font-weight: 600;
  font-family: 'Inter', sans-serif; margin-top: 8px;
}

/* ===== BOOKING MODAL ===== */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 10000;
  align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: white; border-radius: 16px; max-width: 520px; width: 90%;
  max-height: 90vh; overflow-y: auto; padding: 32px;
}
.modal h2 { font-family: 'Playfair Display', Georgia, serif; color: #1B3A5C; margin-bottom: 20px; font-size: 1.5rem; }
.modal .form-group { margin-bottom: 14px; }
.modal label { display: block; font-size: 0.85rem; font-weight: 600; color: #1B3A5C; margin-bottom: 4px; }
.modal input, .modal textarea, .modal select {
  width: 100%; padding: 10px 12px; border: 2px solid #E5E7EB; border-radius: 8px;
  font-family: 'Inter', sans-serif; font-size: 0.95rem; box-sizing: border-box;
}
.modal input:focus, .modal textarea:focus { border-color: #2E86AB; outline: none; }
.modal textarea { resize: vertical; min-height: 80px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions button { flex: 1; padding: 12px; border-radius: 8px; font-size: 1rem; font-weight: 700; cursor: pointer; font-family: 'Inter', sans-serif; }
.btn-cancel-modal { background: none; border: 2px solid #E5E7EB; color: #6B7280; }
.btn-submit-booking { background: #E07A5F; border: none; color: white; }
.btn-submit-booking:hover { background: #C96A50; }

.booking-summary { background: #F5F0E8; border-radius: 8px; padding: 14px; margin-bottom: 16px; font-size: 0.9rem; }
.booking-summary .bs-row { display: flex; justify-content: space-between; padding: 4px 0; }
.booking-summary .bs-total { font-weight: 700; color: #1B3A5C; border-top: 2px solid #D4A843; margin-top: 6px; padding-top: 8px; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: #1B3A5C; color: white; padding: 14px 28px; border-radius: 10px;
  font-weight: 600; font-size: 0.95rem; z-index: 20000; display: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.toast.show { display: block; animation: fadeInUp 0.3s ease; }
@keyframes fadeInUp { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ===== EMBEDDED CALENDAR OVERRIDES ===== */
.embedded-calendar .calendar-container { max-width: 100%; margin: 20px 0; padding: 0; }
.embedded-calendar .admin-panel { max-width: 100%; margin: 20px 0; padding: 0; }
.embedded-calendar .mode-tabs { max-width: 100%; margin: 20px 0 0; padding: 0; }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .cal-day { min-height: 48px; font-size: 0.75rem; }
  .cal-day .rate { font-size: 0.5rem; }
  .cal-day .min-badge { font-size: 0.45rem; padding: 0 2px; }
  .rate-grid, .min-stay-grid, .checkin-checkout-grid { grid-template-columns: repeat(4, 1fr); }
  .season-row { grid-template-columns: 1fr 1fr; }
  .season-multi-header { grid-template-columns: 1fr 1fr; }
  .season-dow-grid { grid-template-columns: repeat(4, 1fr); }
}