/* ==========================================================================
   FSHD Care Navigator - Global Map & Information Directory
   Typography: Tahoma
   Design Aesthetic: Neat, Sober, Elegant Medical Slate & Navy
   ========================================================================== */

:root {
  /* Font Family - Tahoma strictly enforced */
  --font-main: 'Tahoma', system-ui, -apple-system, sans-serif;

  /* Light Theme Color Tokens (Sober Medical Slate Palette) */
  --bg-primary: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-surface-elevated: #F1F5F9;
  --bg-card: #FFFFFF;
  --border-color: #E2E8F0;
  --border-hover: #CBD5E1;

  --text-main: #0F172A;
  --text-muted: #475569;
  --text-subtle: #64748B;
  --text-inverse: #FFFFFF;

  --accent-primary: #0F3B5F; /* Deep Navy */
  --accent-primary-hover: #164E63;
  --accent-teal: #0D9488; /* Medical Teal */
  --accent-teal-light: #CCFBF1;
  --accent-ctrn: #1E40AF; /* Royal Blue badge */
  --accent-ctrn-bg: #EFF6FF;
  --accent-info: #D97706; /* Amber badge */
  --accent-info-bg: #FEF3C7;
  --accent-diag: #7C3AED; /* Purple badge for Diagnostic Centers */
  --accent-diag-bg: #F3E8FF;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-modal: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --header-height: 68px;
  --sidebar-width: 380px;
}

/* Base resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--text-main);
  height: 100%;
  width: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font-family: var(--font-main);
  font-size: 14px;
}

/* Layout App Container */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  background-color: var(--bg-primary);
}

/* Header */
.app-header {
  height: var(--header-height);
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
  gap: 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  max-width: 45%;
  flex-shrink: 1;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background-color: var(--accent-primary);
  color: #FFFFFF;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
  box-shadow: 0 2px 4px rgba(15, 59, 95, 0.3);
  flex-shrink: 0;
}

.brand-title-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.brand-title-group h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-title-group p {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Header Right Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s ease;
}

.btn-header:hover {
  background-color: var(--border-color);
  color: var(--text-main);
}

.user-avatar-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--accent-primary);
  color: #FFFFFF;
  border: 2px solid var(--accent-teal);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  margin-left: 4px;
  flex-shrink: 0;
}

.user-avatar-badge:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-md);
}

.lang-selector {
  padding: 7px 10px;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease;
}

.lang-selector:hover {
  border-color: var(--accent-teal);
}

.view-mode-toggle {
  display: flex;
  background-color: var(--bg-surface-elevated);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.btn-view-mode {
  padding: 6px 12px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-view-mode.active {
  background-color: var(--bg-surface);
  color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}

/* Mobile Filter Trigger Button (hidden by default on desktop) */
.btn-mobile-filter-trigger {
  display: none;
}

/* Main Workspace Body */
.main-workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* Sidebar Filters Panel */
.sidebar-panel {
  width: var(--sidebar-width);
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 900;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-surface);
}

.search-box-wrapper {
  position: relative;
  margin-bottom: 12px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 10px 12px 10px 34px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-primary);
  color: var(--text-main);
  outline: none;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input:focus {
  border-color: var(--accent-teal);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.near-me-btn {
  width: 100%;
  padding: 9px 12px;
  background-color: var(--accent-teal-light);
  color: var(--accent-teal);
  border: 1px solid var(--accent-teal);
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.near-me-btn:hover {
  background-color: var(--accent-teal);
  color: #FFFFFF;
}

.filters-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-subtle);
}

.filter-select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-primary);
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
  font-weight: 500;
  line-height: 1.3;
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--accent-teal);
  width: 16px;
  height: 16px;
  cursor: pointer;
  margin-top: 1px;
  flex-shrink: 0;
}

.filter-reset-bar {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-surface-elevated);
}

.results-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.btn-reset {
  background: none;
  border: none;
  color: var(--accent-teal);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

.mobile-apply-btn-wrapper {
  display: none;
  padding: 12px 16px;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
}

/* Map Section Container */
.map-view-container {
  flex: 1;
  position: relative;
  height: 100%;
  background-color: #E5E7EB;
}

#map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* List Section Container (when in split or list mode) */
.directory-list-container {
  flex: 1;
  background-color: var(--bg-primary);
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.directory-list-container.hidden {
  display: none;
}

/* Layout modes */
.main-workspace.mode-map .directory-list-container {
  display: none;
}

.main-workspace.mode-list .map-view-container {
  display: none;
}

.main-workspace.mode-split .map-view-container {
  flex: 1.2;
}

.main-workspace.mode-split .directory-list-container {
  flex: 1;
  display: flex;
  border-left: 1px solid var(--border-color);
}

/* Center Card Styling - Fully Responsive, No Collapse & Perfect Wrap */
.center-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  position: relative;
  box-sizing: border-box;
  flex-shrink: 0;
  width: 100%;
  min-height: auto;
}

.center-card:hover {
  border-color: var(--accent-teal);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.center-card.selected {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-primary);
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  flex-wrap: wrap;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  flex: 1 1 200px;
  min-width: 0;
  word-break: break-word;
}

.card-type-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
  display: inline-block;
  max-width: 100%;
  align-self: flex-start;
}

.badge-ctrn {
  background-color: var(--accent-ctrn-bg);
  color: var(--accent-ctrn);
  border: 1px solid var(--accent-ctrn);
}

.badge-hospital {
  background-color: var(--bg-surface-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.badge-info {
  background-color: var(--accent-info-bg);
  color: var(--accent-info);
  border: 1px solid var(--accent-info);
}

.badge-diagnostic {
  background-color: var(--accent-diag-bg);
  color: var(--accent-diag);
  border: 1px solid var(--accent-diag);
}

.card-location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.card-doctors {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  background-color: var(--bg-surface-elevated);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-teal);
  word-break: break-word;
}

.doctor-item-sm {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.doctor-role-sm {
  font-size: 11px;
  color: var(--text-subtle);
  font-weight: normal;
}

.card-services-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}

.service-pill {
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  background-color: var(--bg-surface-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
}

.service-diagnostic-pill {
  background-color: var(--accent-diag-bg);
  color: var(--accent-diag);
  border-color: var(--accent-diag);
  font-weight: 600;
}

.card-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-color);
}

.distance-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-teal);
}

.btn-card-details {
  padding: 6px 12px;
  background-color: var(--accent-primary);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.btn-card-details:hover {
  opacity: 0.9;
}

/* Detail Drawer / Modal Panel */
.detail-drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: 440px;
  height: 100%;
  background-color: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  box-shadow: var(--shadow-modal);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.detail-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background-color: var(--bg-surface);
}

.drawer-title-area {
  flex: 1;
  min-width: 0;
}

.drawer-title-area h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  word-break: break-word;
}

.btn-close-drawer {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}

.btn-close-drawer:hover {
  background-color: var(--bg-surface-elevated);
  color: var(--text-main);
}

.drawer-content {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-subtle);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
}

/* Contact Info Item */
.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  color: var(--text-main);
}

.contact-icon {
  color: var(--accent-teal);
  margin-top: 2px;
  flex-shrink: 0;
}

.contact-link {
  color: var(--accent-teal);
  text-decoration: none;
  word-break: break-all;
  font-weight: 600;
}

.contact-link:hover {
  text-decoration: underline;
}

.doctor-card-large {
  padding: 12px;
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.doc-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.doc-title {
  font-size: 12px;
  color: var(--text-muted);
}

.doc-role {
  font-size: 11px;
  color: var(--accent-teal);
  font-weight: 600;
  margin-top: 2px;
}

.drawer-actions-bar {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-surface-elevated);
  display: flex;
  gap: 10px;
}

.btn-drawer-action {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-primary-action {
  background-color: var(--accent-teal);
  color: #FFFFFF;
  border: none;
}

.btn-primary-action:hover {
  background-color: #0F766E;
}

.btn-secondary-action {
  background-color: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary-action:hover {
  background-color: var(--border-color);
}

/* Modals General */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(3px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-overlay.mandatory-auth {
  z-index: 9999;
  background-color: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
}

.modal-container {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-modal);
  overflow: hidden;
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-surface-elevated);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Open, Frameless Animated Authentication Experience */
.login-screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2000;
  display: none !important;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  box-sizing: border-box;
  overflow-y: auto;
  background: transparent;
  pointer-events: none;
}

.login-screen-overlay.open {
  display: flex !important;
  pointer-events: auto;
}

.login-screen-overlay.closing {
  pointer-events: none;
}

.login-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(ellipse at 50% 40%, #FFFFFF 0%, #F1F5F9 55%, #E2E8F0 100%);
  z-index: 1998;
  opacity: 0;
  pointer-events: none;
  display: none !important;
  transition: opacity 0.5s ease;
}

.login-backdrop.open {
  display: block !important;
  opacity: 1;
}

.login-backdrop.closing {
  opacity: 0 !important;
}

.login-screen-overlay.closing .login-card-container {
  opacity: 0 !important;
  transform: scale(1.04) !important;
  pointer-events: none !important;
}

.landing-lang-wrapper {
  position: absolute;
  top: 24px;
  right: 28px;
  z-index: 2100;
}

.landing-lang-wrapper select {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.landing-lang-wrapper select:hover {
  border-color: var(--accent-teal);
}

/* Frameless Container - Perfect Proportion & Spacing */
.login-card-container {
  background: transparent;
  border: none;
  border-radius: 0;
  width: 100%;
  max-width: 440px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: visible;
  animation: framelessEntrance 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes framelessEntrance {
  0% {
    opacity: 0;
    transform: translateY(28px) scale(0.96);
    filter: blur(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.login-card-header {
  padding: 0;
  text-align: center;
  background: transparent;
  margin-bottom: 24px;
}

.landing-about-section {
  margin-top: 16px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.btn-landing-info-action {
  width: 100%;
  max-width: 320px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11.5px 22px;
  background: linear-gradient(135deg, #FFFFFF 0%, #F0FDFA 100%);
  border: 1.5px solid rgba(13, 148, 136, 0.45);
  border-radius: 28px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-teal-dark, #0F766E);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.14);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-landing-info-action:hover {
  border-color: var(--accent-teal);
  background: #FFFFFF;
  box-shadow: 0 6px 22px rgba(13, 148, 136, 0.25);
  transform: translateY(-1.5px);
}

.btn-landing-info-action:hover i.fa-arrow-right {
  transform: translateX(4px);
}

/* Smart Educational Page Modal Styling */
.smart-page-card {
  max-width: 840px;
  width: 92%;
  border-radius: 20px;
  overflow: hidden;
  animation: smartPageEntrance 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes smartPageEntrance {
  0% {
    opacity: 0;
    transform: scale(0.94) translateY(24px);
    filter: blur(6px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

.smart-page-header {
  padding: 24px 28px 16px 28px;
  position: relative;
  background: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
  border-bottom: 1px solid var(--border-color);
}

.smart-page-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background-color: var(--accent-teal-light);
  color: var(--accent-teal);
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 8px;
}

#smart-page-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 6px 0;
  letter-spacing: -0.4px;
}

#smart-page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.45;
}

.smart-page-body {
  padding: 24px 28px;
  max-height: 75vh;
  overflow-y: auto;
}

.smart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.smart-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.smart-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.smart-card-highlight {
  background: linear-gradient(135deg, #F0FDFA 0%, #FFFFFF 100%);
  border-color: rgba(13, 148, 136, 0.35);
}

.smart-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background-color: var(--accent-teal-light);
  color: var(--accent-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 12px;
}

.smart-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 8px 0;
}

.smart-card p {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.smart-footer-banner {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
  border-radius: 16px;
  padding: 20px 24px;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.smart-footer-banner h4 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: #FFFFFF;
}

.smart-footer-banner p {
  font-size: 12.5px;
  color: #94A3B8;
  margin: 0;
}

.landing-about-card {
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04);
}

.landing-about-item h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
}

.landing-about-item p {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

#login-card-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 6px 0;
  letter-spacing: -0.5px;
}

#login-card-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.login-card-body {
  padding: 0;
  display: flex;
  flex-direction: column;
  background: transparent;
}

.auth-tabs {
  display: flex;
  border-bottom: none;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  padding: 4px;
  border-radius: 30px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 9px 16px;
  background: transparent;
  border: none;
  border-radius: 24px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.auth-tab.active {
  color: #FFFFFF;
  background-color: var(--accent-primary);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.auth-input-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  display: block;
  line-height: 1.4;
}

.auth-actions-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  margin-top: 6px;
}

.btn-auth-primary {
  padding: 11.5px 24px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 28px;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.22);
  width: 100%;
  max-width: 320px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-auth-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(13, 148, 136, 0.3);
}

.btn-auth-secondary {
  padding: 9.5px 20px;
  font-size: 12.5px;
  font-weight: 500;
  width: 100%;
  max-width: 320px;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  border-radius: 28px;
  background-color: #FFFFFF;
  transition: all 0.2s ease;
}

.btn-auth-secondary:hover {
  border-color: var(--accent-teal);
  color: var(--text-main);
}

.demo-access-wrapper {
  margin-top: 8px;
  border-top: 1px dashed var(--border-color);
  padding-top: 16px;
  display: flex;
  justify-content: center;
}

.btn-auth-demo {
  width: 100%;
  max-width: 320px;
  background-color: rgba(13, 148, 136, 0.08);
  color: var(--accent-teal);
  border: 1px solid rgba(13, 148, 136, 0.3);
  font-weight: 600;
  padding: 10px 20px;
  font-size: 12.5px;
  border-radius: 28px;
  transition: all 0.2s ease;
}

.btn-auth-demo:hover {
  background-color: rgba(13, 148, 136, 0.16);
  border-color: var(--accent-teal);
}

.login-card-footer {
  text-align: center;
  border-top: none;
  padding: 24px 0 0 0;
  font-size: 12px;
  color: var(--text-subtle);
  background: transparent;
}

.auth-tab.active {
  color: var(--accent-teal);
  border-bottom-color: var(--accent-teal);
  background-color: var(--bg-surface);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-input-wrapper {
  position: relative;
  width: 100%;
}

.auth-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
}

.auth-input {
  width: 100%;
  padding: 11px 36px 11px 38px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: var(--bg-primary);
  color: var(--text-main);
  outline: none;
  font-size: 14px;
}

.auth-input:focus {
  border-color: var(--accent-teal);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.btn-toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
}

.auth-alert {
  display: none;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.alert-success {
  background-color: #D1FAE5;
  color: #065F46;
  border: 1px solid #6EE7B7;
}

.alert-error {
  background-color: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
}

/* Leaflet Custom Marker & Popup Overrides */
.leaflet-popup-content-wrapper {
  font-family: var(--font-main) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
  background-color: var(--bg-surface) !important;
  color: var(--text-main) !important;
  padding: 4px !important;
}

.leaflet-popup-content {
  margin: 12px 14px !important;
  line-height: 1.4 !important;
}

.popup-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-main);
  margin-bottom: 4px;
  word-break: break-word;
}

.popup-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.popup-btn {
  display: inline-block;
  padding: 5px 10px;
  background-color: var(--accent-teal);
  color: #FFFFFF !important;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

/* Custom Marker Pins */
.custom-pin {
  width: 32px;
  height: 32px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 6px rgba(0,0,0,0.3);
  border: 2px solid #FFFFFF;
}

.custom-pin i {
  transform: rotate(45deg);
  color: #FFFFFF;
  font-size: 14px;
}

.pin-ctrn { background-color: #1E40AF; }
.pin-hospital { background-color: #0F3B5F; }
.pin-info { background-color: #D97706; }
.pin-diagnostic { background-color: #7C3AED; }

/* ==========================================================================
   Responsive Mobile UI System (< 768px & < 1024px)
   ========================================================================== */
@media (max-width: 900px) {
  .app-header {
    height: auto;
    padding: 10px 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .header-brand {
    max-width: 100%;
    justify-content: space-between;
  }

  .header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
  }

  .lang-selector, .btn-header {
    font-size: 12px;
    padding: 6px 10px;
  }

  .btn-mobile-filter-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background-color: var(--accent-teal-light);
    color: var(--accent-teal);
    border: 1px solid var(--accent-teal);
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
  }

  /* Hide Split View button on mobile to prevent squished layouts */
  #btn-view-split {
    display: none;
  }

  .view-mode-toggle {
    flex: 1;
  }

  .btn-view-mode {
    flex: 1;
    justify-content: center;
  }

  .main-workspace {
    flex-direction: column;
    position: relative;
  }

  /* Transform Sidebar Panel into a full slide-down filter drawer on Mobile */
  .sidebar-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1200;
    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-modal);
  }

  .sidebar-panel.open-mobile {
    transform: translateY(0);
  }

  .mobile-apply-btn-wrapper {
    display: flex;
  }

  .map-view-container {
    width: 100%;
    height: 100%;
    flex: 1;
  }

  .directory-list-container {
    width: 100%;
    height: 100%;
    flex: 1;
    padding: 12px;
  }

  .detail-drawer {
    width: 100%;
  }
}

/* Subtle Responsive App Footer Bar */
.app-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 8px 24px;
  z-index: 950;
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 100%;
}

.footer-note {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
}

.btn-footer-link {
  background: transparent;
  border: none;
  color: var(--accent-teal);
  font-weight: 700;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  outline: none;
}

.btn-footer-link:hover {
  background-color: var(--accent-teal-light);
  color: var(--accent-teal);
  text-decoration: underline;
}

@media (max-width: 600px) {
  .app-footer {
    padding: 8px 14px;
    font-size: 11px;
  }

  .footer-content {
    justify-content: center;
    text-align: center;
    gap: 6px;
  }

  .footer-note {
    font-size: 11px;
  }

  .btn-footer-link {
    font-size: 11px;
  }
}
