/* ============================================================
   Dogboxx Brand CSS
   Overrides Bootstrap 5 CSS variables to match dogboxx.org
   Primary pink: #E02FAC  |  Dark: #1B1B1B  |  Light bg: #F6F6F6
   ============================================================ */

/* ---- Root variable overrides ---- */
:root {
  --bs-primary:              #E02FAC;
  --bs-primary-rgb:          224, 47, 172;

  /* A slightly deeper pink for hover/active states */
  --db-primary-dark:         #C0258F;
  --db-primary-light:        #F55EC2;
  --db-primary-subtle:       #fce8f6;

  /* Neutral palette */
  --db-dark:                 #1B1B1B;
  --db-surface:              #F6F6F6;
  --db-muted:                #5E5E5E;

  /* Override body */
  --bs-body-bg:              #F6F6F6;
  --bs-body-color:           #1B1B1B;
  --bs-secondary-color:      #5E5E5E;

  /* Links */
  --bs-link-color:           #E02FAC;
  --bs-link-color-rgb:       224, 47, 172;
  --bs-link-hover-color:     #C0258F;
  --bs-link-hover-color-rgb: 192, 37, 143;

  /* Form switches — Bootstrap uses its own variable, doesn't inherit --bs-primary */
  --bs-form-check-input-checked-bg-color:     #E02FAC;
  --bs-form-check-input-checked-border-color: #E02FAC;

  /* Dropdown active state — overrides Bootstrap's default blue highlight */
  --bs-dropdown-link-active-bg:    var(--db-primary-subtle);
  --bs-dropdown-link-active-color: var(--bs-body-color);
}

/* ---- Form switches ---- */
/* Direct property override — more reliable than the CSS variable alone */
.form-switch .form-check-input:checked {
  background-color: #E02FAC;
  border-color:     #E02FAC;
  width: 2.5em;
  height: 1.25em;
}

.form-switch .form-check-input {
  cursor: pointer;
  width: 2.5em;
  height: 1.25em;
}

/* ---- Buttons ---- */
.btn-primary {
  --bs-btn-bg:               #E02FAC;
  --bs-btn-border-color:     #E02FAC;
  --bs-btn-hover-bg:         #C0258F;
  --bs-btn-hover-border-color: #C0258F;
  --bs-btn-active-bg:        #A81E7C;
  --bs-btn-active-border-color: #A81E7C;
  --bs-btn-disabled-bg:      #E02FAC;
  --bs-btn-disabled-border-color: #E02FAC;
  color: #fff;
}

.btn-outline-primary {
  --bs-btn-color:            #E02FAC;
  --bs-btn-border-color:     #E02FAC;
  --bs-btn-hover-bg:         #E02FAC;
  --bs-btn-hover-border-color: #E02FAC;
  --bs-btn-active-bg:        #C0258F;
  --bs-btn-active-border-color: #C0258F;
}

/* ---- Navbar ---- */
.navbar {
  background-color: #1B1B1B !important;
  border-bottom: 3px solid #E02FAC;
}

.navbar-brand,
.navbar-brand:hover {
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Scoped to the top navbar — avoid polluting nav-pills/tabs on light backgrounds */
.navbar .nav-link {
  color: rgba(255, 255, 255, 0.85) !important;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
  color: #E02FAC !important;
}

/* ---- Cards ---- */
.card {
  border: 1px solid #e8e0e6;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(27, 27, 27, 0.06);
}

.card-header {
  background-color: #fff;
  border-bottom: 2px solid #E02FAC;
  font-weight: 600;
}

/* ---- Form controls ---- */
.form-control:focus,
.form-select:focus {
  border-color: #E02FAC;
  box-shadow: 0 0 0 0.2rem rgba(224, 47, 172, 0.2);
}

/* ---- Badges ---- */
.badge.bg-primary {
  background-color: #E02FAC !important;
}

/* ---- Tables ---- */
.table thead th {
  background-color: #1B1B1B;
  color: #fff;
  border-color: #1B1B1B;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.table-hover > tbody > tr:hover > * {
  background-color: var(--db-primary-subtle);
}

/* ---- Alerts — keep semantic colours but tint primary ---- */
.alert-primary {
  background-color: var(--db-primary-subtle);
  border-color: var(--db-primary-light);
  color: var(--db-dark);
}

/* ---- Flash toast container ---- */
#flash-container .alert {
  border-left: 4px solid #E02FAC;
}

/* ---- Page layout tweaks ---- */
body {
  font-family: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

main.container {
  text-align: left; /* override the global text-center on main */
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

/* ---- Headings ---- */
h1, h2, h3 {
  color: #1B1B1B;
  font-weight: 700;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }

/* ---- Page header block (reusable) ---- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #E02FAC;
}

.page-header h1,
.page-header h2 {
  margin: 0;
}



/* ---- Calendar overrides ---- */
.cal-cell.today .cal-day {
  background-color: #E02FAC;
  border-color: #E02FAC;
}

.cal-cell.selected .cal-day {
  background-color: var(--db-primary-dark);
  border-color: var(--db-primary-dark);
}

/* ---- Login / auth pages ---- */

/* ---- Footer ---- */
footer {
  border-top: 1px solid #dee2e6;
  padding: 1rem 0;
  text-align: center;
  font-size: 0.8rem;
  color: var(--db-muted);
  margin-top: 2rem;
}

/* ---- Utility ---- */
.text-primary  { color: #E02FAC !important; }
.bg-primary    { background-color: #E02FAC !important; }
.border-primary { border-color: #E02FAC !important; }
.text-bg-pink  { background-color: #E02FAC !important; color: #fff !important; }

/* ── Availability slot pill (fixed width so dates align) ─── */
.avail-slot-badge {
  min-width: 5.5rem;
  text-align: center;
  flex-shrink: 0;
}

/* ---- AdminLTE overrides ---- */
.app-sidebar {
  background-color: #1B1B1B !important;
}

.app-header {
  background-color: #1B1B1B !important;
  border-bottom: 3px solid #E02FAC !important;
}

/* Sidebar nav links */
.sidebar-menu .nav-link {
  color: rgba(255,255,255,0.75) !important;
  border-radius: 6px;
  margin: 1px 8px;
  transition: background 0.15s;
}

.sidebar-menu .nav-link:hover {
  background-color: rgba(255,255,255,0.08) !important;
  color: #fff !important;
}

.sidebar-menu .nav-link.active {
  background-color: #E02FAC !important;
  color: #fff !important;
}

.nav-header {
  color: rgba(255,255,255,0.4) !important;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 1rem 1rem 0.25rem;
}

/* Content area background */
.app-content {
  background-color: #F6F6F6;
}

/* Content header */
.app-content-header {
  background: #fff;
  border-bottom: 1px solid #e8e0e6;
}

/* ── Flash toasts (shared between client layout and admin layout) ──────── */
#db-toast-container {
  position: fixed; z-index: 1060; display: flex; flex-direction: column;
  gap: 0.5rem; pointer-events: none;
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  left: 1rem; right: 1rem;
}
@media (min-width: 768px) {
  #db-toast-container { bottom: auto; top: 1.25rem; right: 1.25rem; left: auto; width: 340px; }
}
.db-toast {
  pointer-events: all; display: flex; align-items: center; gap: 0.6rem;
  padding: 0.8rem 1rem; border-radius: 1.25rem; font-size: 0.875rem;
  font-weight: 500; line-height: 1.4; color: #fff;
  background: rgba(28, 28, 30, 0.96);
  box-shadow: 0 4px 24px rgba(0,0,0,0.22), 0 1px 6px rgba(0,0,0,0.14);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  animation: db-toast-in 0.28s cubic-bezier(0.34, 1.46, 0.64, 1) both;
  transition: transform 0.12s ease, opacity 0.12s ease;
  will-change: transform, opacity; cursor: default;
  user-select: none; -webkit-user-select: none;
}
.db-toast.db-toast-out { animation: db-toast-out 0.2s ease forwards; }
.db-toast-icon { flex-shrink: 0; font-size: 1rem; }
.db-toast-success .db-toast-icon { color: #4ade80; }
.db-toast-info    .db-toast-icon { color: #60a5fa; }
.db-toast-warning .db-toast-icon { color: #fbbf24; }
.db-toast-error   .db-toast-icon { color: #f87171; }
.db-toast-msg { flex: 1; }
.db-toast-close {
  flex-shrink: 0; background: none; border: none;
  color: rgba(255,255,255,0.45); font-size: 1rem; line-height: 1;
  padding: 0 0 0 0.35rem; cursor: pointer; transition: color 0.15s;
}
.db-toast-close:hover, .db-toast-close:focus { color: #fff; outline: none; }
@keyframes db-toast-in {
  from { opacity: 0; transform: translateY(1.25rem) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes db-toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(1.25rem) scale(0.92); }
}

/* ── Modifier pills (reused from admin board, available globally) ── */
.modifier-pill {
  font-size: 0.65rem;
  padding: 2px 5px;
  border-radius: 8px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

.modifier-both {
  background: rgba(255, 193, 7, 0.15);
  color: #997404;
  border: 1px solid #ffc107;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
}

/* ── Collapsible pickup slot chevron ──────────────────────── */
/* Rotate the chevron when its sibling collapse panel is hidden */
.pickup-slot-header[aria-expanded="false"] .pickup-chevron {
  transform: rotate(-90deg);
}

/* ── Quill-rendered HTML in daily announcements ────────────── */
.ql-content p { margin-bottom: 0.5rem; }
.ql-content ul, .ql-content ol { padding-left: 1.25rem; margin-bottom: 0.5rem; }
.ql-content h1, .ql-content h2, .ql-content h3 { margin-top: 0.75rem; margin-bottom: 0.25rem; }

/* ── Walker: pickup slot section headers ──────────────────── */
.pickup-slot-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: #fff;
  border-bottom: 2px solid #E02FAC;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1B1B1B;
  border-radius: 10px 10px 0 0;
}

.pickup-slot-header .slot-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pickup-slot-header .slot-count {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 600;
  color: #E02FAC;
  letter-spacing: 0;
  text-transform: none;
}

/* Slot accent colours */
.slot-dot-morning-walk  { background: #1B1B1B; }
.slot-dot-afternoon-walk { background: #E02FAC; }
.slot-dot-drop-in       { background: #7c3aed; }

/* ── Walker: pickup order badge ────────────────────────────── */
.pickup-order-badge {
  width: 22px;
  height: 22px;
  font-size: 0.68rem;
  font-weight: 800;
  background: #E02FAC;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(224,47,172,0.35);
}

/* ── Walker: date summary bar ──────────────────────────────── */
.date-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: #1B1B1B;
  border-radius: 10px;
  color: #fff;
}

.date-summary-bar .date-label {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.date-summary-bar .date-today-badge {
  background: #E02FAC;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2em 0.6em;
  border-radius: 20px;
  margin-left: 0.5rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.date-summary-bar .btn-change-date {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 0.25rem 0.65rem;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.date-summary-bar .btn-change-date:hover {
  background: rgba(255,255,255,0.18);
  color: #fff;
}

/* ── Walker: schedule page card left-border accents ────────── */
.card-accent-pink   { border-left: 4px solid #E02FAC !important; }
.card-accent-green  { border-left: 4px solid #22c55e !important; }
.card-accent-amber  { border-left: 4px solid #f59e0b !important; }

/* ── Android Native UX Touch & Gesture Optimizations ──────── */
body {
  /* Remove the grey/blue tap highlight box on iOS and Android Chrome */
  -webkit-tap-highlight-color: transparent;
}

/* Prevent accidental text selection on interactive UI elements */
.btn, .nav-link, .badge, .navbar-brand {
  user-select: none;
  -webkit-user-select: none;
}

/* Add an active scale-down state to simulate physical button presses */
.btn {
  transition: transform 0.1s cubic-bezier(0.2, 0, 0.2, 1), background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
}

.btn:active, .nav-link:active {
  transform: scale(0.96);
}

/* ── Page Transitions (Masking HTTP loads to feel like SPA/Native) ──────── */
@keyframes db-page-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Animate the main content container on both client and admin layouts */
main.container, main.app-main .app-content {
  animation: db-page-fade-in 0.25s cubic-bezier(0.2, 0, 0, 1);
}

/* ── Stat blocks (profile, monthly summary) ─────────────────────────────── */
.stat-block {
  text-align: center;
  padding: 0.75rem 0.5rem;
}
.stat-num {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  color: #E02FAC;
}
.stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #999;
  margin-top: 0.2rem;
}
