:root {
  --primary-color: #FF2E93;
  --secondary-color: #FF8000;
  --bg-gradient: linear-gradient(135deg, #120e1a 0%, #1e1329 100%);
  --surface: rgba(255, 255, 255, 0.08);
  --surface-border: rgba(255, 255, 255, 0.12);
  --text-main: #FFFFFF;
  --text-muted: #B3ADC2;
  --success: #00E676;
  --danger: #FF1744;
  --radius-xl: 28px;
  --radius-lg: 16px;
  --radius-md: 10px;
  --font-family: 'Montserrat', sans-serif;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

.app-container {
  width: 100%;
  max-width: 450px;
  min-height: 100vh;
  position: relative;
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 50px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
}

.glass-card {
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 16px;
}

h1 { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
h2 { font-size: 20px; font-weight: 600; margin-bottom: 12px; }
h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
p { font-size: 14px; color: var(--text-muted); line-height: 1.5; }

.header {
  padding: 20px 24px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  background: rgba(18, 14, 26, 0.85);
  backdrop-filter: blur(12px);
  z-index: 10;
  border-bottom: 1px solid var(--surface-border);
}

.header button {
  background: transparent;
  border: none;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
}

.header .title {
  flex: 1;
  text-align: center;
  font-weight: 600;
  font-size: 18px;
}

.btn {
  width: 100%;
  padding: 16px 24px;
  border-radius: var(--radius-lg);
  font-family: var(--font-family);
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-sos {
  background: linear-gradient(135deg, #FF1744 0%, #FF8A80 100%);
  color: white;
  box-shadow: 0 8px 32px rgba(255, 23, 68, 0.4);
  font-size: 18px;
  padding: 20px 24px;
}

.btn-sos:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(255, 23, 68, 0.6); }

.btn-primary { background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%); color: white; }
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-outline { background: transparent; border: 1px solid var(--primary-color); color: var(--primary-color); }
.btn-success { background: var(--success); color: black; }

.radar-container {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 40px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-dot { width: 20px; height: 20px; background: var(--primary-color); border-radius: 50%; position: relative; z-index: 2; box-shadow: 0 0 15px var(--primary-color); }
.pulse { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 100%; height: 100%; background: rgba(255, 46, 147, 0.2); border-radius: 50%; border: 1px solid rgba(255, 46, 147, 0.5); animation: radar-pulse 2s infinite ease-out; }
.pulse:nth-child(2) { animation-delay: 0.6s; }
.pulse:nth-child(3) { animation-delay: 1.2s; }

@keyframes radar-pulse {
  0% { width: 40px; height: 40px; opacity: 1; }
  100% { width: 200px; height: 200px; opacity: 0; }
}

.provider-card {
  display: flex;
  flex-direction: row;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  gap: 16px;
  cursor: pointer;
  transition: var(--transition);
}

.provider-card:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.2); }
.provider-img { width: 80px; height: 80px; border-radius: var(--radius-md); object-fit: cover; flex-shrink: 0; }
.provider-info { flex: 1; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.provider-name { font-size: 18px; font-weight: 600; margin: 4px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.provider-type { font-size: 11px; text-transform: uppercase; color: var(--secondary-color); font-weight: 700; letter-spacing: 1px; }
.provider-meta { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
.distance-badge { background: rgba(255, 23, 68, 0.15); color: #FF8A80; padding: 4px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; margin-top: 8px; display: inline-flex; align-items: center; gap: 4px; width: max-content; }

.screen { padding: 24px; flex: 1; animation: fade-in 0.3s ease; }
@keyframes fade-in { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }

.slots-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.time-slot { background: rgba(0,0,0,0.4); border: 1px solid var(--surface-border); padding: 12px; text-align: center; border-radius: var(--radius-md); cursor: pointer; font-weight: 600; transition: var(--transition); }
.time-slot:hover { background: var(--primary-color); border-color: var(--primary-color); }
.time-slot.active { background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); color: white; border: none; }

.input-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.input-label { font-size: 13px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 1px; }
.input-field { background: rgba(0,0,0,0.5); border: 1px solid var(--surface-border); border-radius: var(--radius-md); padding: 14px 16px; color: white; font-family: inherit; font-size: 16px; transition: var(--transition); width: 100%; box-sizing: border-box; }
.input-field:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 2px rgba(255, 46, 147, 0.2); }

.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(100px); background: var(--success); color: #000; padding: 16px 24px; border-radius: 50px; font-weight: 600; opacity: 0; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); z-index: 1000; box-shadow: 0 10px 30px rgba(0, 230, 118, 0.4); white-space: nowrap; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.services-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.service-chip { background: rgba(0, 0, 0, 0.4); border: 1px solid var(--surface-border); padding: 16px 12px; border-radius: var(--radius-md); text-align: center; font-size: 13px; font-weight: 600; cursor: pointer; transition: var(--transition); display: flex; align-items: center; justify-content: center; }
.service-chip:hover { background: var(--primary-color); border-color: var(--primary-color); box-shadow: 0 4px 15px rgba(255, 46, 147, 0.3); transform: translateY(-2px); }

/* Portfolio Gallery */
.portfolio-gallery { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; margin-top: 12px; scroll-snap-type: x mandatory; }
.portfolio-gallery::-webkit-scrollbar { height: 6px; }
.portfolio-gallery::-webkit-scrollbar-thumb { background: var(--surface-border); border-radius: 10px; }
.portfolio-item { width: 140px; height: 140px; border-radius: var(--radius-md); object-fit: cover; flex-shrink: 0; scroll-snap-align: start; border: 1px solid rgba(255,255,255,0.1); }

/* Master Registration Form Elements */
.upload-btn { display: flex; align-items: center; justify-content: center; gap: 8px; background: rgba(255,255,255,0.1); border: 2px dashed var(--surface-border); padding: 20px; border-radius: var(--radius-md); cursor: pointer; color: var(--text-muted); transition: var(--transition); text-align: center; }
.upload-btn:hover { border-color: var(--primary-color); color: white; background: rgba(255,46,147,0.1); }
.file-input { display: none; }
.preview-img { width: 100%; height: 200px; border-radius: var(--radius-md); object-fit: cover; margin-top: 12px; display: none; border: 1px solid var(--surface-border); }

/* Multi-select check list */
.check-list { display: flex; flex-direction: column; gap: 10px; max-height: 250px; overflow-y: auto; padding: 12px; background: rgba(0,0,0,0.3); border-radius: var(--radius-md); border: 1px solid var(--surface-border); }
.check-item { display: flex; align-items: center; gap: 12px; font-size: 15px; cursor: pointer; }
.check-item input { width: 20px; height: 20px; accent-color: var(--primary-color); cursor: pointer; }

/* Leaflet Map Overrides */
.leaflet-container {
  background: #120e1a !important;
  font-family: var(--font-family) !important;
}
.leaflet-control-zoom a {
  background: rgba(0,0,0,0.6) !important;
  color: white !important;
  border-color: rgba(255,255,255,0.2) !important;
}
.custom-user-marker {
  animation: pulse-marker 2s infinite;
}
@keyframes pulse-marker {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 46, 147, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 15px rgba(255, 46, 147, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 46, 147, 0); }
}

/* Chat UI */
.chat-container { display: flex; flex-direction: column; height: calc(100vh - 140px); overflow-y: auto; padding: 16px; gap: 12px; }
.message-bubble { max-width: 80%; padding: 12px 16px; border-radius: 16px; font-size: 14px; position: relative; word-wrap: break-word; }
.message-bubble.mine { align-self: flex-end; background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); color: white; border-bottom-right-radius: 4px; }
.message-bubble.theirs { align-self: flex-start; background: rgba(255,255,255,0.1); border: 1px solid var(--surface-border); border-bottom-left-radius: 4px; }
.message-author { font-size: 10px; opacity: 0.7; margin-bottom: 4px; font-weight: bold; }
.message-time { font-size: 9px; opacity: 0.6; position: absolute; bottom: 4px; right: 12px; }
.message-bubble.mine .message-time { color: rgba(255,255,255,0.8); }
.message-bubble.mine { padding-bottom: 18px; }
.message-bubble.theirs { padding-bottom: 18px; }
.chat-input-area { display: flex; gap: 8px; padding: 12px; background: rgba(0,0,0,0.4); border-top: 1px solid var(--surface-border); }
.chat-input { flex: 1; background: rgba(255,255,255,0.1); border: none; border-radius: 20px; padding: 12px 16px; color: white; font-family: inherit; font-size: 14px; outline: none; }
.chat-send-btn { background: var(--primary-color); border: none; width: 44px; height: 44px; border-radius: 50%; color: white; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; }
.chat-send-btn:hover { background: var(--secondary-color); }

/* DaData Autocomplete */
.input-group { position: relative; } /* Ensure dropdown positions correctly */
.dadata-dropdown { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: rgba(18, 14, 26, 0.95); border: 1px solid var(--primary-color); border-radius: var(--radius-md); max-height: 200px; overflow-y: auto; z-index: 1000; backdrop-filter: blur(10px); box-shadow: 0 8px 32px rgba(0,0,0,0.5); display: none; margin: 0; padding: 0; list-style: none; }
.dadata-dropdown.active { display: block; }
.dadata-suggestion { padding: 12px 16px; font-size: 14px; cursor: pointer; border-bottom: 1px solid rgba(255,255,255,0.05); color: #fff; transition: background 0.2s; text-align: left; }
.dadata-suggestion:last-child { border-bottom: none; }
.dadata-suggestion:hover { background: rgba(255, 46, 147, 0.2); }
