/* AB Bikaner — Premium design system */
:root {
  --ab-primary: #0f62fe;
  --ab-primary-hover: #0353e9;
  --ab-primary-soft: #edf5ff;
  --ab-success: #198038;
  --ab-success-soft: #defbe6;
  --ab-success-glow: #24a148;
  --ab-dark: #161616;
  --ab-text: #161616;
  --ab-muted: #525252;
  --ab-border: #e0e0e0;
  --ab-bg: #f4f4f4;
  --ab-surface: #ffffff;
  --ab-radius: 16px;
  --ab-radius-sm: 10px;
  --ab-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
  --ab-shadow-hover: 0 4px 8px rgba(0,0,0,0.06), 0 12px 24px rgba(0,0,0,0.08);
  --ab-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--ab-font);
  color: var(--ab-text);
  background: var(--ab-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

main {
  flex: 1;
}

/* ---------- Navbar ---------- */
.navbar {
  background: rgba(255,255,255,0.92) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ab-border) !important;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.navbar-brand {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: var(--ab-dark) !important;
}

.navbar-brand span {
  font-weight: 500;
  color: var(--ab-muted);
  font-size: 0.85rem;
  letter-spacing: 0;
}

.nav-link {
  font-weight: 500;
  color: var(--ab-muted) !important;
  font-size: 0.95rem;
  padding: 0.4rem 0.75rem !important;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
  color: var(--ab-dark) !important;
  background: var(--ab-bg);
}

/* ---------- Buttons ---------- */
.btn {
  font-weight: 600;
  border-radius: var(--ab-radius-sm);
  letter-spacing: -0.2px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--ab-primary);
  border-color: var(--ab-primary);
  box-shadow: 0 1px 2px rgba(15, 98, 254, 0.25);
}

.btn-primary:hover, .btn-primary:focus {
  background: var(--ab-primary-hover);
  border-color: var(--ab-primary-hover);
  box-shadow: 0 4px 12px rgba(15, 98, 254, 0.35);
}

.btn-outline-primary {
  color: var(--ab-primary);
  border-color: #a6c8ff;
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--ab-primary-soft);
  border-color: var(--ab-primary);
  color: var(--ab-primary-hover);
}

.btn-success {
  background: var(--ab-success);
  border-color: var(--ab-success);
}

.btn-success:hover {
  background: #0e6027;
  border-color: #0e6027;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1.05rem;
  border-radius: 12px;
}

.contact-btn {
  border-radius: 10px;
  font-weight: 600;
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
}

/* ---------- Cards ---------- */
.card {
  background: var(--ab-surface);
  border: 1px solid var(--ab-border);
  border-radius: var(--ab-radius);
  box-shadow: var(--ab-shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--ab-shadow-hover);
  transform: translateY(-2px);
}

.card-available {
  border-color: #a7f0ba;
  background: linear-gradient(135deg, #ffffff 0%, #f6fef8 100%);
  position: relative;
}

.card-available::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--ab-success-glow);
  border-radius: 4px 0 0 4px;
}

.card-body {
  padding: 1.25rem 1.35rem;
}

/* ---------- Badges ---------- */
.badge-available {
  background: var(--ab-success-soft);
  color: var(--ab-success);
  font-weight: 700;
  font-size: 0.72rem;
  padding: 0.4em 0.75em;
  border-radius: 999px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
}

.badge-available::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--ab-success-glow);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(36, 161, 72, 0.25);
  animation: pulse-dot 1.8s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.85); }
}

.badge-category {
  background: var(--ab-primary-soft);
  color: var(--ab-primary);
  font-weight: 600;
  font-size: 0.72rem;
  padding: 0.35em 0.7em;
  border-radius: 6px;
  letter-spacing: 0.15px;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(165deg, #0f62fe 0%, #0043ce 45%, #001d6c 100%);
  color: #fff;
  padding: 4.5rem 0 3.5rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(255,255,255,0.12) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(15, 98, 254, 0.4) 0%, transparent 50%);
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: 1.15;
  margin-bottom: 1rem;
  color: #fff;
}

.hero .lead {
  font-size: 1.2rem;
  color: rgba(255,255,255,0.9);
  max-width: 480px;
  font-weight: 400;
  line-height: 1.55;
}

.hero .text-muted {
  color: rgba(255,255,255,0.7) !important;
}

.hero .btn-primary {
  background: #fff;
  color: var(--ab-primary);
  border-color: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.hero .btn-primary:hover {
  background: #f4f4f4;
  color: var(--ab-primary-hover);
  border-color: #f4f4f4;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.hero .btn-outline-primary {
  color: #fff;
  border-color: rgba(255,255,255,0.5);
  background: transparent;
}

.hero .btn-outline-primary:hover {
  background: rgba(255,255,255,0.12);
  border-color: #fff;
  color: #fff;
}

.hero-visual {
  font-size: 5rem;
  opacity: 0.9;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.2));
}

/* ---------- Sections ---------- */
.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 1.35rem;
  color: var(--ab-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title .count {
  font-weight: 500;
  color: var(--ab-muted);
  font-size: 0.95rem;
}

/* ---------- Forms ---------- */
.form-control, .form-select {
  border-radius: var(--ab-radius-sm);
  border-color: var(--ab-border);
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus, .form-select:focus {
  border-color: var(--ab-primary);
  box-shadow: 0 0 0 3px rgba(15, 98, 254, 0.15);
}

.form-label {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--ab-dark);
  margin-bottom: 0.4rem;
}

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
  color: var(--ab-muted);
  background: var(--ab-surface);
  border-radius: var(--ab-radius);
  border: 1px dashed var(--ab-border);
}

.empty-state i {
  font-size: 2.75rem;
  margin-bottom: 0.85rem;
  opacity: 0.4;
  color: var(--ab-muted);
}

.empty-state p {
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Stats ---------- */
.stat-card {
  text-align: center;
  padding: 1.5rem 1rem;
}

.stat-card .number {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--ab-primary);
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.stat-card .label {
  font-size: 0.8rem;
  color: var(--ab-muted);
  font-weight: 500;
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ---------- Availability ---------- */
.avail-on {
  color: var(--ab-success);
  font-weight: 700;
  font-size: 0.9rem;
}

.avail-off {
  color: #a8a8a8;
  font-weight: 500;
  font-size: 0.9rem;
}

/* ---------- Alerts ---------- */
.alert {
  border-radius: var(--ab-radius-sm);
  border: none;
  font-weight: 500;
}

/* ---------- Footer ---------- */
footer {
  background: var(--ab-surface) !important;
  border-top: 1px solid var(--ab-border) !important;
  margin-top: auto;
}

footer a:hover {
  color: var(--ab-primary) !important;
}

/* ---------- Utility ---------- */
.text-primary {
  color: var(--ab-primary) !important;
}

.bg-white {
  background: var(--ab-surface) !important;
}

/* ---------- Mobile refinements ---------- */
@media (max-width: 767.98px) {
  .hero {
    padding: 3rem 0 2.5rem;
    text-align: center;
  }

  .hero h1 {
    font-size: 1.95rem;
    letter-spacing: -0.8px;
  }

  .hero .lead {
    font-size: 1.05rem;
    margin-left: auto;
    margin-right: auto;
  }

  .hero .d-flex {
    justify-content: center !important;
  }

  .card:hover {
    transform: none;
  }

  .section-title {
    font-size: 1.2rem;
  }

  .btn-lg {
    padding: 0.7rem 1.25rem;
    font-size: 1rem;
  }
}

@media (max-width: 575.98px) {
  .hero h1 {
    font-size: 1.75rem;
  }

  .card-body {
    padding: 1.1rem 1.15rem;
  }
}

/* Smooth page feel */
.card, .btn, .form-control, .form-select, .nav-link {
  will-change: transform;
}

/* ---------- AB Help Bot ---------- */
#ab-bot-fab {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 1050;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--ab-primary);
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(15, 98, 254, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

#ab-bot-fab:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 20px rgba(15, 98, 254, 0.5);
}

#ab-bot-panel {
  position: fixed;
  bottom: 5.5rem;
  right: 1.25rem;
  z-index: 1050;
  width: min(360px, calc(100vw - 2rem));
  max-height: min(480px, 70vh);
  background: var(--ab-surface);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
  border: 1px solid var(--ab-border);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  overflow: hidden;
}

#ab-bot-panel.ab-bot-panel--open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.ab-bot-header {
  background: linear-gradient(135deg, #0f62fe, #0043ce);
  color: #fff;
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ab-bot-header strong {
  font-size: 0.95rem;
  font-weight: 700;
}

.ab-bot-header small {
  display: block;
  opacity: 0.85;
  font-size: 0.75rem;
  font-weight: 400;
}

#ab-bot-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.9;
  padding: 0.2rem;
}

#ab-bot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: #f8f9fb;
  min-height: 200px;
}

.ab-bot-msg {
  max-width: 88%;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.ab-bot-msg--bot {
  background: #fff;
  border: 1px solid var(--ab-border);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.ab-bot-msg--user {
  background: var(--ab-primary);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

#ab-bot-typing {
  display: none;
  padding: 0 1rem 0.5rem;
  font-size: 0.8rem;
  color: var(--ab-muted);
}

.ab-bot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.5rem 1rem 0;
  background: #f8f9fb;
}

.ab-bot-chips button {
  border: 1px solid var(--ab-border);
  background: #fff;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ab-dark);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.ab-bot-chips button:hover {
  background: var(--ab-primary-soft);
  border-color: #a6c8ff;
  color: var(--ab-primary);
}

#ab-bot-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--ab-border);
  background: #fff;
}

#ab-bot-input {
  flex: 1;
  border: 1px solid var(--ab-border);
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  font-size: 0.9rem;
  outline: none;
}

#ab-bot-input:focus {
  border-color: var(--ab-primary);
  box-shadow: 0 0 0 2px rgba(15, 98, 254, 0.15);
}

#ab-bot-form button[type="submit"] {
  background: var(--ab-primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.55rem 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

@media (max-width: 480px) {
  #ab-bot-panel {
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
    bottom: 5rem;
  }
  #ab-bot-fab {
    right: 0.75rem;
    bottom: 0.75rem;
  }
}
