/* SARAJ.MK — Design System (Matka / Treska / Saraj nature) */
:root {
  --color-forest: #1B4332;
  --color-leaf: #2D6A4F;
  --color-river: #1D3557;
  --color-sky: #457B9D;
  --color-sand: #F1FAEE;
  --color-mist: #E9F5F0;
  --color-accent: #D4A373;
  --color-text: #1A1A1A;
  --color-muted: #5C6B63;
  --color-border: #C8DDD4;
  --color-white: #ffffff;
  --font-brand: "Source Serif 4", Georgia, serif;
  --font-ui: "Figtree", system-ui, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(27, 67, 50, 0.08);
  --shadow-md: 0 4px 16px rgba(27, 67, 50, 0.12);
  --shadow-lg: 0 8px 32px rgba(27, 67, 50, 0.16);
  --header-h: 64px;
  --mobile-nav-h: 64px;
  --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  color: var(--color-text);
  background: var(--color-sand);
  line-height: 1.6;
  margin: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

body.has-mobile-nav { padding-bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0)); }

h1, h2, h3, h4, h5, h6,
.brand-font {
  font-family: var(--font-brand);
  font-weight: 600;
  line-height: 1.25;
  color: var(--color-forest);
}

a { color: var(--color-leaf); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-river); }

img { max-width: 100%; height: auto; display: block; }

/* Bootstrap overrides */
.btn-primary {
  --bs-btn-bg: var(--color-leaf);
  --bs-btn-border-color: var(--color-leaf);
  --bs-btn-hover-bg: var(--color-forest);
  --bs-btn-hover-border-color: var(--color-forest);
  --bs-btn-active-bg: var(--color-forest);
  --bs-btn-active-border-color: var(--color-forest);
}
.btn-outline-primary {
  --bs-btn-color: var(--color-leaf);
  --bs-btn-border-color: var(--color-leaf);
  --bs-btn-hover-bg: var(--color-leaf);
  --bs-btn-hover-border-color: var(--color-leaf);
}
.btn-accent {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-forest);
  font-weight: 600;
}
.btn-accent:hover { background: #c4935f; border-color: #c4935f; color: var(--color-forest); }
.text-primary { color: var(--color-leaf) !important; }
.bg-primary { background-color: var(--color-leaf) !important; }
.form-control:focus, .form-select:focus {
  border-color: var(--color-sky);
  box-shadow: 0 0 0 0.2rem rgba(69, 123, 157, 0.2);
}

/* Site header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  height: var(--header-h);
}
.site-header .navbar { height: var(--header-h); padding: 0 1rem; }
.site-logo { display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-brand); font-weight: 700; font-size: 1.25rem; color: var(--color-forest); }
.site-logo img { height: 36px; width: auto; }
.site-nav .nav-link {
  color: var(--color-text);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
}
.site-nav .nav-link:hover, .site-nav .nav-link.active {
  color: var(--color-leaf);
  background: var(--color-mist);
}
.lang-switcher .btn { font-size: 0.75rem; padding: 0.2rem 0.5rem; }
.lang-switcher .btn.active { background: var(--color-leaf); color: #fff; border-color: var(--color-leaf); }

/* Hero */
.hero-section {
  position: relative;
  background: linear-gradient(135deg, var(--color-forest) 0%, var(--color-river) 60%, var(--color-sky) 100%);
  color: var(--color-sand);
  padding: 3.5rem 0 4rem;
  overflow: hidden;
}
.hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/public/assets/images/hero-saraj.svg") center/cover no-repeat;
  opacity: 0.35;
}
.hero-section .container { position: relative; z-index: 1; }
.hero-title { font-size: clamp(1.75rem, 5vw, 2.75rem); color: var(--color-sand); margin-bottom: 0.75rem; }
.hero-subtitle { font-size: 1.1rem; opacity: 0.9; max-width: 560px; margin-bottom: 1.5rem; }
.hero-search {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 0.5rem;
  box-shadow: var(--shadow-lg);
  max-width: 640px;
}
.hero-search .form-control { border: 0; box-shadow: none; }
.hero-search .btn { border-radius: var(--radius-md); padding: 0.6rem 1.25rem; }

/* Sections */
.section { padding: 3rem 0; }
.section-alt { background: var(--color-mist); }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.section-title { font-size: 1.5rem; margin: 0; }
.section-lead { color: var(--color-muted); margin: 0; font-size: 0.95rem; }

/* Cards */
.card-saraj {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}
.card-saraj:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card-saraj .card-img-wrap {
  aspect-ratio: 16/10;
  background: var(--color-mist);
  overflow: hidden;
  position: relative;
}
.card-saraj .card-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.card-saraj .card-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; }
.card-saraj .card-title { font-size: 1rem; margin-bottom: 0.35rem; }
.card-saraj .card-meta { font-size: 0.8rem; color: var(--color-muted); margin-bottom: 0.5rem; }
.card-saraj .card-text { font-size: 0.875rem; color: var(--color-muted); flex: 1; }

/* Badges */
.badge-verified { background: var(--color-sky); color: #fff; }
.badge-premium { background: var(--color-accent); color: var(--color-forest); }
.badge-featured { background: var(--color-leaf); color: #fff; }
.badge-status { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }

/* Business card */
.business-card .rating { color: var(--color-accent); font-weight: 600; font-size: 0.85rem; }
.business-card .badges { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-bottom: 0.5rem; }

/* Category grid */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; }
.category-tile {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  text-align: center;
  transition: all var(--transition);
}
.category-tile:hover { border-color: var(--color-leaf); background: var(--color-mist); }
.category-tile .icon { font-size: 1.75rem; margin-bottom: 0.5rem; }
.category-tile .name { font-weight: 600; font-size: 0.9rem; color: var(--color-forest); }
.category-tile .count { font-size: 0.75rem; color: var(--color-muted); }

/* Pricing cards */
.pricing-card {
  background: var(--color-white);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  height: 100%;
}
.pricing-card.featured { border-color: var(--color-leaf); box-shadow: var(--shadow-md); }
.pricing-card .price { font-size: 2rem; font-family: var(--font-brand); color: var(--color-forest); }
.pricing-card .price small { font-size: 0.875rem; color: var(--color-muted); }

/* Emergency shortcuts */
.emergency-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; }
.emergency-item {
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}
.emergency-item .number { font-size: 1.25rem; font-weight: 700; color: #b91c1c; font-family: var(--font-brand); }
.emergency-item .label { font-size: 0.8rem; color: var(--color-muted); }

/* Map CTA */
.map-cta {
  background: linear-gradient(to right, var(--color-mist), var(--color-sand));
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}
#saraj-map, .map-container { height: 400px; border-radius: var(--radius-md); border: 1px solid var(--color-border); z-index: 1; }
.map-container.sm { height: 280px; }

/* Banner area */
.banner-slot img { border-radius: var(--radius-md); width: 100%; }

/* Forms */
.form-page { max-width: 480px; margin: 0 auto; }
.form-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}
.form-label { font-weight: 600; font-size: 0.875rem; color: var(--color-forest); }
.form-hint { font-size: 0.8rem; color: var(--color-muted); }
.is-invalid + .invalid-feedback { display: block; }

/* Alerts */
.alert-saraj { border-radius: var(--radius-md); border: 0; padding: 0.875rem 1rem; }
.alert-success-saraj { background: #d8f3dc; color: var(--color-forest); }
.alert-error-saraj { background: #fee2e2; color: #991b1b; }
.alert-info-saraj { background: #dbeafe; color: var(--color-river); }
.alert-warning-saraj { background: #fef3c7; color: #92400e; }

/* Flash */
.flash-messages { position: fixed; top: calc(var(--header-h) + 0.5rem); right: 1rem; z-index: 1050; max-width: 360px; }
.flash-messages .alert { margin-bottom: 0.5rem; box-shadow: var(--shadow-md); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--color-white);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
}
.empty-state .icon { font-size: 3rem; opacity: 0.4; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.15rem; }
.empty-state p { color: var(--color-muted); max-width: 400px; margin: 0 auto 1rem; }

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--color-mist) 25%, #dceee6 50%, var(--color-mist) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-text { height: 1rem; margin-bottom: 0.5rem; }
.skeleton-img { aspect-ratio: 16/10; }

/* Pagination */
.pagination-saraj .page-link {
  color: var(--color-leaf);
  border-color: var(--color-border);
  border-radius: var(--radius-sm) !important;
  margin: 0 2px;
}
.pagination-saraj .page-item.active .page-link {
  background: var(--color-leaf);
  border-color: var(--color-leaf);
}

/* Breadcrumbs */
.breadcrumb-saraj {
  background: transparent;
  padding: 0.75rem 0;
  margin: 0;
  font-size: 0.85rem;
}
.breadcrumb-saraj .breadcrumb-item a { color: var(--color-muted); }
.breadcrumb-saraj .breadcrumb-item.active { color: var(--color-forest); }

/* Filters sidebar */
.filters-panel {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}
.filters-panel h6 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-muted); }

/* Detail pages */
.detail-hero {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  padding: 2rem 0;
}
.detail-meta { display: flex; flex-wrap: wrap; gap: 1rem; font-size: 0.875rem; color: var(--color-muted); }
.detail-content { background: var(--color-white); border-radius: var(--radius-md); padding: 1.5rem; border: 1px solid var(--color-border); }

/* Business mini-site */
.biz-site-header {
  position: relative;
  min-height: 220px;
  background: var(--color-river);
  color: #fff;
}
.biz-cover {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.5;
}
.biz-header-content {
  position: relative;
  z-index: 1;
  padding: 2rem 0 1rem;
  display: flex;
  align-items: flex-end;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.biz-logo {
  width: 88px;
  height: 88px;
  border-radius: var(--radius-md);
  border: 3px solid #fff;
  background: var(--color-white);
  object-fit: cover;
  box-shadow: var(--shadow-md);
}
.biz-nav {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 1020;
}
.biz-nav .nav-link { color: var(--color-text); font-weight: 500; font-size: 0.9rem; padding: 0.75rem 1rem; }
.biz-nav .nav-link.active { color: var(--color-leaf); border-bottom: 2px solid var(--color-leaf); }
.biz-contact-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.biz-hours table { width: 100%; font-size: 0.875rem; }
.biz-hours td { padding: 0.25rem 0; }
.biz-hours td:last-child { text-align: right; font-weight: 500; }

/* Chat widget */
.chat-widget {
  position: fixed;
  bottom: calc(var(--mobile-nav-h) + 1rem);
  right: 1rem;
  z-index: 1040;
}
.chat-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-leaf);
  color: #fff;
  border: 0;
  box-shadow: var(--shadow-lg);
  font-size: 1.5rem;
  cursor: pointer;
}
.chat-panel {
  display: none;
  position: absolute;
  bottom: 68px;
  right: 0;
  width: 320px;
  max-height: 400px;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  flex-direction: column;
  overflow: hidden;
}
.chat-panel.open { display: flex; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1rem; max-height: 280px; }
.chat-msg { margin-bottom: 0.75rem; font-size: 0.875rem; }
.chat-msg.mine { text-align: right; }
.chat-msg .bubble {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--color-mist);
  max-width: 85%;
}
.chat-msg.mine .bubble { background: var(--color-leaf); color: #fff; }
.chat-input { display: flex; border-top: 1px solid var(--color-border); }
.chat-input input { flex: 1; border: 0; padding: 0.75rem; }
.chat-input button { border: 0; background: var(--color-leaf); color: #fff; padding: 0 1rem; }

/* Reviews */
.review-item { border-bottom: 1px solid var(--color-border); padding: 1rem 0; }
.review-item:last-child { border-bottom: 0; }
.stars { color: var(--color-accent); }

/* Account sidebar */
.account-layout { display: grid; grid-template-columns: 240px 1fr; gap: 1.5rem; }
.account-nav .nav-link { color: var(--color-text); padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); font-size: 0.9rem; }
.account-nav .nav-link.active, .account-nav .nav-link:hover { background: var(--color-mist); color: var(--color-leaf); }
.stat-card { background: var(--color-white); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 1.25rem; text-align: center; }
.stat-card .value { font-size: 1.75rem; font-family: var(--font-brand); color: var(--color-forest); }

/* Footer */
.site-footer {
  background: var(--color-forest);
  color: var(--color-mist);
  padding: 3rem 0 1.5rem;
  margin-top: 2rem;
}
.site-footer a { color: var(--color-sand); opacity: 0.85; }
.site-footer a:hover { opacity: 1; color: #fff; }
.site-footer h6 { color: var(--color-sand); font-family: var(--font-brand); margin-bottom: 1rem; }
.site-footer .footer-bottom { border-top: 1px solid rgba(255,255,255,0.15); margin-top: 2rem; padding-top: 1rem; font-size: 0.85rem; opacity: 0.7; }

/* Mobile bottom nav */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--mobile-nav-h);
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
  z-index: 1030;
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
}
.mobile-nav-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
}
.mobile-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.65rem;
  color: var(--color-muted);
  padding: 0.35rem 0.5rem;
  text-decoration: none;
  gap: 2px;
}
.mobile-nav a .icon { font-size: 1.25rem; }
.mobile-nav a.active, .mobile-nav a:hover { color: var(--color-leaf); }

/* Error pages */
.error-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}
.error-code { font-size: 5rem; font-family: var(--font-brand); color: var(--color-leaf); line-height: 1; opacity: 0.5; }

/* Maintenance */
.maintenance-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-mist), var(--color-sand));
  text-align: center;
  padding: 2rem;
}

/* Admin polish hooks (portal pages referencing admin-like tables) */
.table-saraj { font-size: 0.875rem; }
.table-saraj th { background: var(--color-mist); color: var(--color-forest); font-weight: 600; }

/* Legal compliance */
.independence-disclaimer {
  background: #fff8e6 !important;
  border: 1px solid #e0b84a !important;
  border-radius: 12px;
  padding: 1rem 1.15rem !important;
  font-size: 0.95rem;
  color: #1a1a1a;
}
.independence-disclaimer strong { color: var(--color-forest); }
.platform-private-label {
  font-size: 0.7rem;
  line-height: 1.2;
  max-width: 9rem;
  color: var(--color-sky) !important;
}
.cookie-consent-banner {
  z-index: 1080;
}

/* Auth pages */
.auth-shell {
  min-height: calc(100vh - var(--header-h) - 8rem);
  display: flex;
  align-items: center;
  background:
    radial-gradient(circle at 10% 20%, rgba(45, 106, 79, 0.08), transparent 40%),
    radial-gradient(circle at 90% 10%, rgba(188, 108, 37, 0.08), transparent 35%),
    linear-gradient(180deg, #f7faf8 0%, #eef4f0 100%);
}
.auth-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  padding: 2rem 1.75rem;
}
.auth-card .form-control-lg {
  font-size: 1rem;
  padding: 0.75rem 1rem;
}
.auth-card-brand img {
  height: auto;
}

/* Admin panel polish */
.admin-shell body,
body:has(.admin-nav) {
  background: #f4f7f5;
}
.admin-nav {
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.06);
}
.admin-nav a {
  border-radius: 0.4rem;
  padding: 0.45rem 0.6rem !important;
}
.admin-nav a:hover {
  background: rgba(255,255,255,0.08);
}

/* Utilities */
.text-muted-saraj { color: var(--color-muted) !important; }
.bg-mist { background: var(--color-mist) !important; }
.rounded-saraj { border-radius: var(--radius-md) !important; }
.gap-section { margin-bottom: 2rem; }

/* Responsive */
@media (max-width: 991.98px) {
  .site-nav-desktop { display: none !important; }
  .mobile-nav { display: block; }
  body { padding-bottom: var(--mobile-nav-h); }
  .account-layout { grid-template-columns: 1fr; }
  .account-nav { display: flex; overflow-x: auto; gap: 0.25rem; padding-bottom: 0.5rem; }
  .chat-widget { bottom: calc(var(--mobile-nav-h) + 0.5rem); }
}
@media (min-width: 992px) {
  .mobile-nav { display: none !important; }
  body.has-mobile-nav { padding-bottom: 0; }
}
