/**
 * Find A Daycare Kenya - Main Stylesheet
 * Brand Colors: Purple #6F42C1, Pink #F7B6D2, Blue #B8C7FF
 */

/* ============================================================
   CSS VARIABLES
============================================================ */
:root {
  --purple:      #6F42C1;
  --purple-dark: #5a32a3;
  --purple-light:#8B5CF6;
  --pink:        #F7B6D2;
  --pink-dark:   #e8a0c0;
  --blue:        #B8C7FF;
  --white:       #FFFFFF;
  --gray-bg:     #F8F9FA;
  --gray-light:  #E9ECEF;
  --gray-mid:    #ADB5BD;
  --text-dark:   #1A1A2E;
  --text-muted:  #6C757D;
  --success:     #198754;
  --shadow-sm:   0 2px 8px rgba(111,66,193,0.10);
  --shadow-md:   0 4px 20px rgba(111,66,193,0.15);
  --shadow-lg:   0 8px 40px rgba(111,66,193,0.20);
  --radius-sm:   8px;
  --radius-md:   16px;
  --radius-lg:   24px;
  --font-main:   'Plus Jakarta Sans', sans-serif;
  --font-body:   'DM Sans', sans-serif;
}

/* ============================================================
   BASE
============================================================ */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  color: var(--text-dark);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-main);
  font-weight: 700;
  color: var(--text-dark);
}

a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--purple-dark); }

img { max-width: 100%; height: auto; }

/* ============================================================
   UTILITY CLASSES
============================================================ */
.text-purple     { color: var(--purple) !important; }
.text-pink       { color: var(--pink-dark) !important; }
.bg-purple       { background-color: var(--purple) !important; }
.bg-pink         { background-color: var(--pink) !important; }
.bg-soft-purple  { background-color: rgba(111,66,193,0.06) !important; }
.bg-gray         { background-color: var(--gray-bg) !important; }

/* ============================================================
   BUTTONS
============================================================ */
.btn-purple {
  background: var(--purple);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-family: var(--font-main);
  transition: all 0.25s ease;
  padding: 0.5rem 1.25rem;
}
.btn-purple:hover, .btn-purple:focus {
  background: var(--purple-dark);
  color: white;
  box-shadow: 0 4px 14px rgba(111,66,193,0.35);
  transform: translateY(-1px);
}

.btn-pink {
  background: var(--pink);
  color: var(--purple-dark);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-family: var(--font-main);
  transition: all 0.25s ease;
}
.btn-pink:hover {
  background: var(--pink-dark);
  color: var(--purple-dark);
  transform: translateY(-1px);
}

.btn-outline-purple {
  border: 2px solid var(--purple);
  color: var(--purple);
  border-radius: var(--radius-sm);
  font-weight: 600;
  background: transparent;
  transition: all 0.25s ease;
}
.btn-outline-purple:hover {
  background: var(--purple);
  color: white;
}

/* ============================================================
   NAVBAR
============================================================ */
.navbar {
  z-index: 1000;
  border-bottom: 1px solid var(--gray-light);
  padding: 0.5rem 0;
  min-height: 60px;
}

/* ── Navbar Logo ── */
.navbar-logo {
  width: auto;
  height: 34px;          /* controls the logo height in the navbar */
  max-width: 120px;      /* prevents oversized square logos from breaking layout */
  object-fit: contain;   /* keeps aspect ratio - never distorts */
  object-position: left center;
  display: block;
  border-radius: 6px;
}

/* ── Footer Logo ── */
.footer-logo {
  width: auto;
  height: 38px;
  max-width: 120px;
  object-fit: contain;
  object-position: left center;
  display: block;
  border-radius: 6px;
}

/* ── Admin topbar Logo ── */
.admin-nav-logo {
  width: auto;
  height: 28px;
  max-width: 100px;
  object-fit: contain;
  object-position: left center;
  display: block;
  border-radius: 5px;
}

/* ── Auth page Logo (login / register) ── */
.auth-logo img {
  width: auto;
  height: 52px;
  max-width: 140px;
  object-fit: contain;
  border-radius: 10px;
}

/* ── Navbar brand text ── */
.navbar-brand {
  padding-top: 0;
  padding-bottom: 0;
}

.navbar-brand .brand-text {
  font-family: var(--font-main);
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-dark);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.nav-link {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-dark) !important;
  padding: 0.5rem 0.75rem !important;
  border-radius: 8px;
  transition: all 0.2s;
}
.nav-link:hover, .nav-link.active {
  color: var(--purple) !important;
  background: var(--gray-bg);
}

.skip-link {
  position: absolute; top: 10px; left: 10px;
  background: var(--purple); color: white;
  padding: 8px 16px; border-radius: 8px; z-index: 9999;
}

/* ============================================================
   PWA INSTALL BAR
============================================================ */
.pwa-install-bar {
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
}

/* ============================================================
   HERO SECTION
============================================================ */
.hero-section {
  background: linear-gradient(135deg, #f3eeff 0%, #fce4f0 50%, #e8eeff 100%);
  padding: 5rem 0 4rem;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(111,66,193,0.12) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -80px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(247,182,210,0.25) 0%, transparent 70%);
  border-radius: 50%;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-dark);
}

.hero-title span { color: var(--purple); }

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-muted);
  max-width: 600px;
}

/* Search bar */
.hero-search-box {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 2;
}

.hero-search-box .form-control,
.hero-search-box .form-select {
  border: none;
  border-radius: var(--radius-sm);
  background: var(--gray-bg);
  font-size: 0.95rem;
  padding: 0.65rem 1rem;
}

.hero-search-box .form-control:focus,
.hero-search-box .form-select:focus {
  box-shadow: 0 0 0 3px rgba(111,66,193,0.15);
  background: white;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.hero-stat-item {
  text-align: center;
}

.hero-stat-number {
  font-family: var(--font-main);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--purple);
  line-height: 1;
}

.hero-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============================================================
   SECTION STYLES
============================================================ */
.section-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 2rem;
}

/* ============================================================
   DAYCARE CARDS
============================================================ */
.daycare-card {
  border-radius: var(--radius-md) !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}

.daycare-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg) !important;
}

.daycare-card-img-wrap {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.daycare-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.daycare-card:hover .daycare-card-img {
  transform: scale(1.05);
}

.btn-fav {
  position: absolute;
  top: 10px; right: 10px;
  background: white;
  border: none;
  border-radius: 50%;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: all 0.2s;
  color: var(--text-muted);
  z-index: 2;
}
.btn-fav:hover, .btn-fav.active {
  color: #e74c3c;
  transform: scale(1.1);
}

.badge-featured {
  position: absolute;
  top: 10px; left: 10px;
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  z-index: 2;
}

.badge-tag {
  background: var(--gray-bg);
  color: var(--text-muted);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  display: inline-block;
}

.stars-sm i { font-size: 0.8rem; }

/* ============================================================
   HOW IT WORKS
============================================================ */
.how-step-icon {
  width: 70px; height: 70px;
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.75rem;
  color: white;
  box-shadow: 0 4px 15px rgba(111,66,193,0.3);
}

.how-step-number {
  position: absolute;
  top: -8px; right: -8px;
  background: var(--pink);
  color: var(--purple-dark);
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
}

/* ============================================================
   BLOG CARDS
============================================================ */
.blog-card {
  border-radius: var(--radius-md) !important;
  border: none !important;
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md) !important;
}
.blog-card-img {
  height: 200px;
  object-fit: cover;
  width: 100%;
}
.blog-category-badge {
  background: var(--purple);
  color: white;
  border-radius: 20px;
  padding: 2px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-block;
}

/* ============================================================
   SEARCH PAGE FILTERS
============================================================ */
.filters-sidebar {
  background: white;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 80px;
}

.filter-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--purple);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--gray-light);
}

.filter-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ============================================================
   DAYCARE DETAIL PAGE
============================================================ */
.daycare-gallery {
  border-radius: var(--radius-md);
  overflow: hidden;
}

.gallery-main img {
  width: 100%;
  height: 420px;
  object-fit: cover;
}

.gallery-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.gallery-thumb {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  flex-shrink: 0;
  border: 2px solid transparent;
}
.gallery-thumb:hover, .gallery-thumb.active {
  opacity: 1;
  border-color: var(--purple);
}

.amenity-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gray-bg);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  margin: 4px;
}

.info-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-light);
  position: sticky;
  top: 80px;
}

/* ============================================================
   DASHBOARD LAYOUT
============================================================ */
.dashboard-wrapper {
  display: flex;
  min-height: calc(100vh - 72px);
}

.dashboard-sidebar {
  width: 260px;
  min-width: 260px;
  background: white;
  border-right: 1px solid var(--gray-light);
  padding: 1.5rem 0;
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow-y: auto;
}

.dashboard-sidebar .nav-link {
  padding: 0.65rem 1.5rem !important;
  border-radius: 0 !important;
  border-left: 3px solid transparent;
  font-size: 0.9rem;
}
.dashboard-sidebar .nav-link.active,
.dashboard-sidebar .nav-link:hover {
  border-left-color: var(--purple);
  background: var(--gray-bg) !important;
  color: var(--purple) !important;
}

.dashboard-main {
  flex: 1;
  padding: 2rem;
  background: var(--gray-bg);
  min-width: 0;
}

.stat-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-light);
  transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); }

.stat-card-icon {
  width: 50px; height: 50px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
}

/* ============================================================
   ADMIN PANEL
============================================================ */
.admin-sidebar {
  width: 250px;
  min-width: 250px;
  background: var(--text-dark);
  min-height: calc(100vh - 60px);
  padding: 1.5rem 0;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}

.admin-sidebar .nav-link {
  color: rgba(255,255,255,0.7) !important;
  padding: 0.65rem 1.5rem !important;
  border-radius: 0 !important;
  border-left: 3px solid transparent;
  font-size: 0.88rem;
  transition: all 0.2s;
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
  color: white !important;
  border-left-color: var(--purple);
  background: rgba(111,66,193,0.15) !important;
}

.admin-main {
  flex: 1;
  padding: 2rem;
  background: var(--gray-bg);
  min-width: 0;
}

/* ============================================================
   FORM CONTROLS
============================================================ */
.form-control, .form-select, .form-check-input {
  border-radius: var(--radius-sm);
  border-color: var(--gray-light);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(111,66,193,0.15);
}
.form-label {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

/* Range input */
input[type="range"] {
  accent-color: var(--purple);
}

/* ============================================================
   AUTH PAGES
============================================================ */
.auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #f3eeff 0%, #fce4f0 50%, #e8eeff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 460px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

/* auth-logo img sizing is defined in the NAVBAR section above */

/* ============================================================
   POPULAR TOWNS
============================================================ */
.town-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 2px solid var(--gray-light);
  border-radius: var(--radius-sm);
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-dark);
  transition: all 0.2s;
  cursor: pointer;
  text-decoration: none;
}
.town-chip:hover {
  border-color: var(--purple);
  color: var(--purple);
  background: var(--gray-bg);
  text-decoration: none;
}

/* ============================================================
   TESTIMONIALS
============================================================ */
.testimonial-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--purple);
  height: 100%;
}

.testimonial-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--purple);
}

/* ============================================================
   REVIEW FORM
============================================================ */
.star-rating {
  display: flex;
  gap: 4px;
  flex-direction: row-reverse;
  justify-content: flex-end;
}
.star-rating input { display: none; }
.star-rating label {
  font-size: 1.8rem;
  color: #ddd;
  cursor: pointer;
  transition: color 0.15s;
}
.star-rating input:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label {
  color: #f5a623;
}

/* ============================================================
   MAP
============================================================ */
#daycare-map {
  width: 100%;
  height: 350px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* ============================================================
   BACK TO TOP
============================================================ */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--purple);
  color: white;
  border: none;
  border-radius: 50%;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s;
  z-index: 999;
  box-shadow: var(--shadow-md);
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}
.back-to-top:hover { background: var(--purple-dark); }

/* ============================================================
   FOOTER
============================================================ */
/* Override Bootstrap's text-muted inside the dark footer */
.footer .text-muted {
  color: rgba(255,255,255,0.55) !important;
}

.footer-links li { margin-bottom: 0.5rem; }
.footer-links a {
  color: rgba(255,255,255,0.65);
  font-size: 0.88rem;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--pink); }

.footer-social {
  color: rgba(255,255,255,0.55);
  transition: color 0.2s;
}
.footer-social:hover { color: var(--pink) !important; }

/* Copyright bar */
.footer-bottom-text {
  color: rgba(255,255,255,0.55);
  font-size: 0.85rem;
}

/* ============================================================
   BREADCRUMBS
============================================================ */
.breadcrumb {
  font-size: 0.85rem;
  background: transparent;
  padding: 0;
}
.breadcrumb-item a { color: var(--purple); }
.breadcrumb-item.active { color: var(--text-muted); }

/* ============================================================
   ALERTS & BADGES
============================================================ */
.badge-status-approved   { background: #d4edda; color: #155724; }
.badge-status-pending    { background: #fff3cd; color: #856404; }
.badge-status-rejected   { background: #f8d7da; color: #721c24; }

/* ============================================================
   LOADING SPINNER
============================================================ */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.spinner-purple {
  color: var(--purple);
}

/* ============================================================
   WYSIWYG EDITOR AREA
============================================================ */
#blog-editor-toolbar {
  background: var(--gray-bg);
  border: 1px solid var(--gray-light);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  padding: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.editor-btn {
  background: white;
  border: 1px solid var(--gray-light);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}
.editor-btn:hover { background: var(--purple); color: white; border-color: var(--purple); }

#blog-editor {
  border: 1px solid var(--gray-light);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  min-height: 350px;
  padding: 1rem;
  font-size: 0.95rem;
  outline: none;
}

#blog-editor:focus {
  box-shadow: inset 0 0 0 2px rgba(111,66,193,0.2);
}

/* ============================================================
   IMAGE UPLOAD PREVIEW
============================================================ */
.img-upload-area {
  border: 2px dashed var(--gray-light);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.img-upload-area:hover, .img-upload-area.drag-over {
  border-color: var(--purple);
  background: var(--gray-bg);
}

.img-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 1rem;
}

.img-preview-item {
  position: relative;
  width: 100px;
  height: 80px;
}
.img-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}
.img-preview-remove {
  position: absolute;
  top: -6px; right: -6px;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px; height: 20px;
  font-size: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* ============================================================
   MOBILE RESPONSIVE
============================================================ */
@media (max-width: 991px) {
  .dashboard-wrapper { flex-direction: column; }
  .dashboard-sidebar {
    width: 100%;
    min-width: unset;
    height: auto;
    position: relative;
    top: 0;
    border-right: none;
    border-bottom: 1px solid var(--gray-light);
    padding: 0.75rem 0;
  }
  .dashboard-sidebar .nav-link {
    padding: 0.5rem 1rem !important;
    display: inline-flex;
    font-size: 0.82rem;
  }
  .dashboard-sidebar .nav { flex-direction: row; flex-wrap: wrap; padding: 0 1rem; gap: 4px; }
  .dashboard-main { padding: 1.25rem; }

  .admin-sidebar {
    width: 100%;
    min-width: unset;
    min-height: auto;
    height: auto;
    position: relative;
    top: 0;
  }

  .gallery-main img { height: 260px; }
  .info-card { position: relative; top: 0; }
  .filters-sidebar { position: relative; top: 0; margin-bottom: 1rem; }
}

@media (max-width: 576px) {
  .hero-section { padding: 3rem 0 2.5rem; }
  .auth-card { padding: 1.75rem 1.25rem; }
  .hero-stats { gap: 1.25rem; }
  .hero-stat-number { font-size: 1.4rem; }

  /* Slightly smaller logo on very small screens */
  .navbar-logo { height: 28px; }
  .navbar-brand .brand-text { font-size: 0.88rem; }
}

/* ============================================================
   PRINT
============================================================ */
@media print {
  .navbar, .footer, .back-to-top, .btn { display: none !important; }
}
