/* FloodSaathi Main Stylesheet (PRD Mobile-first, >=48px touch targets, high-contrast) */
@import url("./fonts.css");

:root {
  --font-family: "Noto Sans", "Noto Sans Devanagari", "Noto Sans Gurmukhi", sans-serif;
  --bg-primary: #0f172a;
  --bg-surface: #1e293b;
  --bg-surface-elevated: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --brand-primary: #0284c7;
  --brand-hover: #0369a1;
  --brand-accent: #38bdf8;
  
  --status-safe: #10b981;
  --status-safe-bg: rgba(16, 185, 129, 0.15);
  --status-watch: #eab308;
  --status-watch-bg: rgba(234, 179, 8, 0.15);
  --status-warning: #f97316;
  --status-warning-bg: rgba(249, 115, 22, 0.15);
  --status-danger: #ef4444;
  --status-danger-bg: rgba(239, 68, 68, 0.2);

  --border-subtle: #334155;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --touch-target: 48px;
}

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

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

/* Header & Navigation */
.app-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.brand-icon {
  width: 36px;
  height: 36px;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Language selector */
.lang-selector {
  display: flex;
  background-color: var(--bg-surface-elevated);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.lang-btn {
  min-width: 44px;
  min-height: 36px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-btn.active {
  background-color: var(--brand-primary);
  color: #ffffff;
}

/* Offline Notice Banner */
.offline-banner {
  background-color: #b45309;
  color: #ffffff;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.offline-banner.hidden {
  display: none;
}

/* Persistent Emergency Bar */
.helpline-bar {
  background-color: #1e1b4b;
  border-bottom: 1px solid #312e81;
  padding: 8px 16px;
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.helpline-link {
  min-height: var(--touch-target);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 6px 14px;
  background: #dc2626;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.helpline-link.secondary {
  background: #4338ca;
}

.helpline-link:active {
  transform: scale(0.97);
}

/* Main Content Views */
main {
  flex: 1;
  padding: 16px;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
}

.view-section {
  display: none;
}

.view-section.active {
  display: block;
}

/* Bottom Tab Navigation */
.tab-bar {
  position: sticky;
  bottom: 0;
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-around;
  z-index: 100;
  padding: 4px 0 calc(env(safe-area-inset-bottom, 0px) + 4px);
}

.tab-btn {
  flex: 1;
  min-height: var(--touch-target);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.tab-btn.active {
  color: var(--brand-accent);
}

/* Card components */
.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Buttons */
.btn {
  min-height: var(--touch-target);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  margin-top: 8px;
}

.btn-primary {
  background-color: var(--brand-primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--brand-hover);
}

.btn-danger {
  background-color: #dc2626;
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #b91c1c;
}

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

.btn-outline:hover {
  background-color: var(--bg-surface-elevated);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

.badge-age {
  background-color: var(--bg-surface-elevated);
  color: var(--text-secondary);
}

.badge-official {
  background-color: #0369a1;
  color: #ffffff;
}
