/* Custom TruNanny styles */
/* WhatsApp Baileys gem chat styles are loaded separately via stylesheet_link_tag */

/* === Turbo Progress Bar === */
.turbo-progress-bar {
  background-color: #8224E3;
  height: 3px;
  z-index: 9999;
}

/* === Story 2: Color overrides === */
:root {
  --bs-primary: #8224E3;
  --bs-primary-rgb: 130, 36, 227;
}

.text-primary { color: #8224E3 !important; }
.bg-primary { background-color: #8224E3 !important; }

/* === Story 3: Typography === */
body {
  font-family: 'Roboto', sans-serif;
  font-weight: 400;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: 'Roboto', sans-serif;
  font-weight: 600;
}

.navbar-brand {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
}

.lead, .card-body p, .text-muted.small {
  font-family: 'Roboto Slab', serif;
  font-weight: 400;
}

.brand-wordmark {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
}

/* === Story 4: Button and Component Styling === */
.btn {
  border-radius: 16px;
}

/* Bootstrap 5.2+ uses component-scoped CSS variables for buttons.
   Overriding --bs-primary at :root alone does not cascade into btn-primary.
   We must set the button-specific variables directly. */
.btn-primary {
  --bs-btn-bg: #8224E3;
  --bs-btn-border-color: #8224E3;
  --bs-btn-hover-bg: #6a1cb8;
  --bs-btn-hover-border-color: #6a1cb8;
  --bs-btn-active-bg: #6a1cb8;
  --bs-btn-active-border-color: #6a1cb8;
  --bs-btn-disabled-bg: #8224E3;
  --bs-btn-disabled-border-color: #8224E3;
  background-color: #8224E3 !important;
  border-color: #8224E3 !important;
  color: #FFFFFF !important;
  border-radius: 16px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(95, 45, 222, 0.15);
  transition: all 0.2s ease;
}
.btn-primary:hover, .btn-primary:focus {
  background-color: #6a1cb8 !important;
  border-color: #6a1cb8 !important;
}

.btn-outline-primary {
  --bs-btn-color: #8224E3;
  --bs-btn-border-color: #8224E3;
  --bs-btn-hover-bg: #8224E3;
  --bs-btn-hover-border-color: #8224E3;
  --bs-btn-active-bg: #8224E3;
  --bs-btn-active-border-color: #8224E3;
  color: #8224E3;
  border-color: #8224E3;
  border-radius: 16px;
}
.btn-outline-primary:hover {
  background-color: #8224E3;
  color: #FFFFFF;
}

/* nav-pills active tab: Bootstrap 5.2+ uses --bs-nav-pills-link-active-bg
   which is not always inherited from --bs-primary in pre-compiled bundles */
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
  --bs-nav-pills-link-active-bg: #8224E3;
  background-color: #8224E3;
  color: #FFFFFF;
}

.nav-pills .nav-link:not(.active) {
  border: 2px solid #dee2e6;
  color: #6c757d;
  background-color: transparent;
  border-radius: 16px;
}
.nav-pills .nav-link:not(.active):hover {
  background-color: #8224E3;
  border-color: #8224E3;
  color: #FFFFFF;
}

.card {
  border-radius: 25px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.form-control, .form-select {
  border-radius: 12px;
}

.badge.bg-success { background-color: #00C6A0 !important; }
.badge.bg-primary { background-color: #8224E3 !important; }
.btn-success { background-color: #00C6A0 !important; border-color: #00C6A0 !important; color: white !important; }
.btn-success:hover, .btn-success:focus { background-color: #00b091 !important; border-color: #00b091 !important; color: white !important; }

/* === Star Rating === */
.cursor-pointer { cursor: pointer; }
.rating-stars { color: #ffc107; cursor: pointer; }

/* === WhatsApp button === */
.btn-whatsapp { background-color: #25D366; color: white; }
.btn-whatsapp:hover { background-color: #1ebe5d; color: white; }

/* === Avatar preview === */
.avatar-preview { width: 80px; height: 80px; object-fit: cover; }
.avatar-sm { width: 48px; height: 48px; }

/* === Autocomplete dropdown === */
.autocomplete-results { z-index: 1000; max-height: 320px; overflow-y: auto; }

/* === Micro typography === */
.text-xs { font-size: 0.65rem; }

/* === Admin WhatsApp chat container === */
.admin-wa-container { height: 500px; overflow: hidden; position: relative; }
.admin-user-whatsapp .wa-chat-list { display: none !important; }
.admin-user-whatsapp .wa-messages-panel { flex: 1 1 100% !important; width: 100% !important; max-height: 500px !important; overflow-y: auto !important; }
.admin-user-whatsapp .wa-chat-shell { height: 100% !important; max-height: 500px !important; }
.booking-wa-family .wa-chat-list, .booking-wa-sitter .wa-chat-list { display: none !important; }
.booking-wa-family .wa-messages-panel, .booking-wa-sitter .wa-messages-panel { flex: 1 1 100% !important; width: 100% !important; }
.booking-wa-family .whatsapp-chat-shell, .booking-wa-sitter .whatsapp-chat-shell { height: 520px !important; border: none !important; border-radius: 0 !important; }
.booking-wa-family .card, .booking-wa-sitter .card { overflow: hidden; }

/* === Admin booking chat history === */
.admin-chat-history { max-height: 400px; overflow-y: auto; }

/* === Admin calendar column widths === */
.cal-col-sitter { min-width: 150px; }
.cal-col-day { min-width: 100px; }

/* === Approval avatar === */
.avatar-56 { width: 56px; height: 56px; object-fit: cover; }

/* === Review rating distribution bars === */
.review-star-label { width: 20px; }
.review-progress { height: 8px; }
.review-count-label { width: 24px; }

/* === Admin reviews comment column === */
.review-comment-col { max-width: 200px; }

/* === Auth card widths === */
.card-otp { max-width: 28rem; width: 100%; }
.card-register { max-width: 32rem; width: 100%; }
.role-card { min-height: 110px; border-width: 2px !important; }
.role-card-subtitle { line-height: 1.2; }

/* === Autocomplete dropdown === */
.dropdown-results { z-index: 1000; max-height: 320px; overflow-y: auto; }

/* === Home page === */
.hero-bg { background: linear-gradient(135deg, #F3EAFF 0%, #E8D5FF 50%, #F0E0FF 100%); overflow: hidden; }
.hero-deco-lg { bottom: -30px; left: -30px; width: 120px; height: 120px; background: rgba(130,36,227,0.15); border-radius: 50%; }
.hero-deco-sm { top: -20px; right: -20px; width: 80px; height: 80px; background: rgba(130,36,227,0.1); border-radius: 50%; }
@media (max-width: 575px) {
  .hero-deco-lg, .hero-deco-sm { display: none; }
  .hero-cta-btn { width: 100%; }
}
.feature-icon { width: 56px; height: 56px; }
.feature-icon-purple { background-color: rgba(130,36,227,0.1); }
.feature-icon-teal { background-color: rgba(0,198,160,0.1); }
.feature-icon-amber { background-color: rgba(255,168,0,0.15); }
.feature-icon-blue { background-color: rgba(0,180,255,0.1); }
.cta-bg { background: linear-gradient(135deg, #5F2DDE 0%, #FF3672 100%); }

/* === Admin recurring groups matrix === */
.matrix-scroll { overflow-x: auto; }
.matrix-table { min-width: max-content; }
.matrix-col-md { min-width: 140px; }
.matrix-col-sm { min-width: 100px; }
.matrix-col-xs { min-width: 80px; }

.step-circle { width: 44px; height: 44px; font-size: 1.1rem; }

/* === Mobile Polish (Story 5) === */
@media (max-width: 767px) {
  /* Calendar: smaller fonts, minimum cell height, horizontal scroll hint */
  .table-responsive table th,
  .table-responsive table td {
    font-size: 0.75rem;
    min-height: 70px;
    padding: 0.25rem;
  }
  .table-responsive table .badge {
    font-size: 0.65rem;
  }

  /* Cancellation form full-width on mobile */
  #cancelForm {
    width: 100%;
  }
  #cancelForm .form-control {
    width: 100%;
  }
}

/* === Chat scroll container === */
.chat-scroll {
  max-height: 300px;
  overflow-y: auto;
}

/* === Calendar cell sizing === */
.calendar-cell {
  min-height: 100px;
}

/* Touch target minimum 44px */
.btn, .nav-link, .form-check-input, .form-check-label,
.navbar-toggler, a.link-primary {
  min-height: 44px;
  min-width: 44px;
}

/* === Certification fieldset: reset browser-default padding/border so
   Bootstrap's .form-check padding-left is the only indent applied === */
.cert-fieldset {
  padding: 0;
  border: none;
  margin: 0;
}
.cert-fieldset legend {
  padding: 0;
  margin-bottom: 0.5rem;
}
.cert-fieldset .form-check {
  padding-left: 1.75em;
}
.cert-fieldset .form-check-input {
  /* Override the global 44px touch-target min-height/min-width which breaks
     Bootstrap's float layout and causes checkboxes to stair-step.
     Bootstrap already handles float and margin-left positioning.
     Explicit width/height at 1.25em (~20px) overrides Bootstrap's 1em default
     and keeps the checkbox clearly visible at all zoom levels. */
  width: 1.25em;
  height: 1.25em;
  min-height: 1.25em;
  min-width: 1.25em;
}
.cert-fieldset .form-check-label {
  min-height: unset;
  min-width: unset;
}

.admin-bookings-table td, .admin-bookings-table th { padding-top: 0.6rem; padding-bottom: 0.6rem; }

.admin-users-table { white-space: nowrap; }
