/* ==========================================================================
   DR. NARESH HOSPITAL - ULTRA CLEAN MOBILE-FIRST PREMIUM HEALTHCARE UI
   Zero Horizontal Overflow, Modern Touch-Target Buttons & Apple/Apollo Aesthetics
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #0F3D6E;
  --primary-dark: #0A294A;
  --primary-gradient: linear-gradient(135deg, #0B335E 0%, #155496 100%);
  --secondary: #00B074;
  --secondary-gradient: linear-gradient(135deg, #00B074 0%, #009663 100%);
  --accent: #EF4444;
  --dark: #0F172A;
  --text-main: #1E293B;
  --text-muted: #64748B;
  --bg-page: #F8FAFC;
  --bg-card: #FFFFFF;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 20px rgba(15, 61, 110, 0.08);
  --shadow-lg: 0 14px 34px rgba(15, 61, 110, 0.12);
  
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-full: 9999px;
  
  --bottom-nav-height: 64px;
}

/* Global Reset - Strict Mobile Fit */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.5;
  font-size: 14px;
}

/* Mobile bottom spacing for bottom app bar */
body {
  padding-bottom: calc(var(--bottom-nav-height) + 16px);
}

@media (min-width: 861px) {
  body {
    padding-bottom: 0;
  }
}

h1, h2, h3, h4, h5, h6 {
  color: var(--dark);
  font-weight: 700;
  line-height: 1.25;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* Responsive Container */
.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Top Mini Announcement */
.top-bar {
  background: var(--dark);
  color: #E2E8F0;
  font-size: 11.5px;
  padding: 6px 0;
}

.top-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.emergency-pill {
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 11px;
}

/* Header */
.site-header {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 999;
  border-bottom: 1px solid var(--border);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--primary-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(15, 61, 110, 0.25);
  flex-shrink: 0;
}

.brand-text h1 {
  font-size: 17px;
  letter-spacing: -0.3px;
  color: var(--primary);
  margin: 0;
}

.brand-text span {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}

/* Desktop Navigation Links */
.nav-links {
  display: none;
  align-items: center;
  gap: 16px;
}

@media (min-width: 861px) {
  .nav-links {
    display: flex;
  }
}

.nav-links li a {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.nav-links li a:hover,
.nav-links li a.active {
  color: var(--primary);
  background: #EBF4FC;
}

/* Header Action (Phone call on mobile) */
.header-right-action {
  display: flex;
  align-items: center;
  gap: 8px;
}

.call-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #E8F8F2;
  color: var(--secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: bold;
}

/* ==========================================================================
   MOBILE APP BOTTOM NAVIGATION BAR
   ========================================================================== */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--bottom-nav-height);
  background: #FFFFFF;
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
  z-index: 9999;
  padding: 4px 8px;
}

@media (min-width: 861px) {
  .mobile-bottom-nav {
    display: none;
  }
}

.bottom-nav-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 100%;
  align-items: center;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
  gap: 2px;
  padding: 4px 0;
}

.bottom-nav-item .nav-icon {
  font-size: 18px;
}

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-item.central-cta .nav-icon-bubble {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-top: -22px;
  box-shadow: 0 4px 14px rgba(15, 61, 110, 0.35);
  border: 3px solid #fff;
}

/* ==========================================================================
   BUTTONS (Ultra Modern, Clean Touch Targets)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 12px rgba(15, 61, 110, 0.2);
}

.btn-secondary {
  background: var(--secondary-gradient);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 176, 116, 0.25);
}

.btn-outline {
  background: #fff;
  color: var(--primary);
  border: 1.5px solid var(--border);
}

.btn-outline-white {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
}

.btn-lg {
  padding: 13px 24px;
  font-size: 14.5px;
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   HERO SECTION (Clean, Impactful, Compact on Mobile)
   ========================================================================== */
.hero-clean {
  background: linear-gradient(135deg, #0A294A 0%, #0F3D6E 100%);
  color: #fff;
  padding: 30px 0 40px;
  position: relative;
}

.hero-clean-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 861px) {
  .hero-clean-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
  }
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.12);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  width: fit-content;
}

.hero-tag .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--secondary);
}

.hero-clean h1 {
  color: #fff;
  font-size: 26px;
  line-height: 1.25;
}

@media (min-width: 861px) {
  .hero-clean h1 {
    font-size: 36px;
  }
}

.hero-clean h1 span {
  color: #34D399;
}

.hero-clean p {
  color: #CBD5E1;
  font-size: 13px;
  line-height: 1.5;
  max-width: 500px;
}

.hero-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* 4-Card Quick App Grid */
.quick-app-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: -20px;
  margin-bottom: 28px;
  position: relative;
  z-index: 10;
}

.app-action-card {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 14px 6px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.app-action-card:active {
  transform: scale(0.95);
}

.app-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.icon-blue { background: #EBF4FC; color: var(--primary); }
.icon-green { background: #E8F8F2; color: var(--secondary); }
.icon-purple { background: #F3E8FF; color: #7C3AED; }
.icon-red { background: #FEE2E2; color: var(--accent); }

.app-action-card span {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--dark);
}

/* Sections */
.section {
  padding: 28px 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 16px;
}

.section-head h2 {
  font-size: 19px;
  letter-spacing: -0.3px;
}

.section-head a {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--primary);
}

/* Responsive Doctor Cards Grid */
.doctor-scroll-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

@media (max-width: 600px) {
  .doctor-scroll-grid {
    grid-template-columns: 1fr;
  }
}

.doc-card-modern {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.doc-img-box {
  position: relative;
  height: 180px;
  background: #E2E8F0;
}

.doc-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.doc-live-chip {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 4px;
}

.doc-live-chip .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--secondary);
}

.doc-card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.doc-card-body h3 {
  font-size: 15px;
  margin-bottom: 2px;
}

.doc-spec-badge {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 4px;
}

.doc-exp {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
  flex-grow: 1;
}

/* Service Cards */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.service-box-clean {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  text-align: center;
  transition: all 0.2s;
}

.service-box-clean .s-icon {
  font-size: 24px;
  margin-bottom: 6px;
}

.service-box-clean h4 {
  font-size: 13px;
  margin-bottom: 2px;
}

.service-box-clean p {
  font-size: 11px;
  color: var(--text-muted);
}

/* Form Cards & Inputs */
.form-card {
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 20px 16px;
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 600px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--dark);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230F3D6E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 32px;
}

/* Alerts */
.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 12.5px;
}

.alert-success { background: #E8F8F2; color: #065F46; border: 1px solid #A7F3D0; }
.alert-danger { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.alert-info { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }

/* Medicine Page */
.medicine-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 992px) {
  .medicine-layout {
    grid-template-columns: 1fr 320px;
  }
}

.category-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.category-pills::-webkit-scrollbar {
  display: none;
}

.pill-btn {
  background: #F1F5F9;
  border: 1px solid var(--border);
  color: var(--dark);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.pill-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.medicine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

@media (max-width: 480px) {
  .medicine-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}

.medicine-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.med-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.med-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.badge-Tablet { background: #EBF4FC; color: var(--primary); }
.badge-Syrup { background: #FEF3C7; color: #B45309; }
.badge-Injection { background: #FEE2E2; color: #B91C1C; }
.badge-Drops { background: #CCFBF1; color: #0F766E; }
.badge-Capsule { background: #F3E8FF; color: #7E22CE; }

.med-name {
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 2px;
}

.med-manufacturer {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.med-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: 10px;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.med-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.med-price {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
}

/* Cart Container */
.cart-sidebar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.cart-items-list {
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 10px;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 12px;
}

.cart-qty-ctrl {
  display: flex;
  align-items: center;
  gap: 4px;
}

.qty-btn {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: #F1F5F9;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
}

.cart-remove-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 14px;
  margin-left: 4px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
}

.summary-row.total {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
  border-top: 1px dashed var(--border);
  padding-top: 6px;
  margin-top: 6px;
}

/* Payment QR & Upload */
.payment-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 861px) {
  .payment-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.qr-box {
  background: #fff;
  border: 2px dashed var(--primary);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.qr-image-wrap {
  width: 180px;
  height: 180px;
  margin: 0 auto 10px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.qr-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.amount-highlight {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent);
  margin: 6px 0;
}

.file-upload-box {
  border: 2px dashed #94A3B8;
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  background: #F8FAFC;
  cursor: pointer;
  margin-bottom: 10px;
}

.file-upload-box input[type="file"] {
  display: none;
}

/* Tables & Badges */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.custom-table th {
  background: #F1F5F9;
  color: var(--primary);
  padding: 8px 10px;
  font-weight: 700;
  text-align: left;
}

.custom-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.status-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 10.5px;
  font-weight: 700;
}

.status-Pending { background: #FEF3C7; color: #B45309; }
.status-Confirmed { background: #EBF4FC; color: var(--primary); }
.status-Completed, .status-Verified { background: #E8F8F2; color: #065F46; }
.status-Cancelled, .status-Failed { background: #FEE2E2; color: #991B1B; }
.status-Uploaded { background: #EEF2FF; color: #4338CA; }

/* Patient Portal Tabs */
.portal-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 16px;
}

.portal-tab-btn {
  flex: 1;
  padding: 10px;
  background: none;
  border: none;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.portal-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.portal-tab-pane {
  display: none;
}

.portal-tab-pane.active {
  display: block;
}

/* Footer */
.site-footer {
  background: var(--dark);
  color: #94A3B8;
  padding: 30px 0 16px;
  font-size: 12px;
}

.footer-bottom {
  text-align: center;
  color: #64748B;
}

/* Toast System */
#toast-container {
  position: fixed;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toast-success { background: #059669; }
.toast-error { background: #DC2626; }
.toast-info { background: #2563EB; }

.toast-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  margin-left: 8px;
}
