/* Flood & Quake Alert - Demo Styles */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --primary: #6366f1;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: clamp(10px, 2vw, 14px);
}

.app {
  height: 100%;
  width: 100%;
  position: relative;
  padding-bottom: clamp(50px, 12vw, 70px);
  overflow: hidden;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(8px, 2vw, 16px) clamp(12px, 3vw, 20px);
}

.header h1 {
  font-size: clamp(14px, 3vw, 20px);
  font-weight: 700;
}

.date {
  font-size: clamp(9px, 1.5vw, 12px);
  color: var(--text-muted);
}

.notification-btn, .back-btn {
  width: clamp(28px, 6vw, 40px);
  height: clamp(28px, 6vw, 40px);
  background: var(--surface);
  border: none;
  border-radius: clamp(8px, 2vw, 12px);
  font-size: clamp(12px, 2.5vw, 18px);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* Screens */
.screen {
  display: none;
  animation: fadeIn 0.3s ease;
  height: calc(100% - 70px);
  overflow-y: auto;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Weather Card */
.weather-card {
  margin: 0 clamp(12px, 3vw, 20px) clamp(12px, 3vw, 20px);
  border-radius: clamp(12px, 3vw, 20px);
  overflow: hidden;
  position: relative;
  height: clamp(180px, 40vw, 280px);
}

.weather-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #0D47A1 0%, #1565C0 25%, #42A5F5 50%, #FFB74D 75%, #FF8A65 100%);
}

.weather-content {
  position: relative;
  padding: clamp(10px, 2vw, 16px);
  color: white;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.weather-top {
  display: flex;
  justify-content: space-between;
  font-size: clamp(9px, 1.5vw, 12px);
  opacity: 0.9;
}

.weather-main {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(8px, 2vw, 16px) 0;
}

.time-display {
  display: flex;
  align-items: baseline;
}

.time {
  font-size: clamp(28px, 8vw, 48px);
  font-weight: 200;
}

.ampm {
  font-size: clamp(10px, 2vw, 14px);
  margin-left: 4px;
}

.temp-display {
  text-align: right;
}

.temp {
  font-size: clamp(20px, 5vw, 32px);
  font-weight: 400;
  display: block;
}

.condition {
  font-size: clamp(9px, 1.5vw, 12px);
  opacity: 0.8;
}

.weather-details {
  font-size: clamp(8px, 1.4vw, 11px);
  opacity: 0.7;
  display: flex;
  gap: clamp(8px, 2vw, 16px);
  margin-bottom: clamp(6px, 1.5vw, 12px);
}

.forecast {
  display: flex;
  justify-content: space-between;
  padding-top: clamp(6px, 1.5vw, 12px);
  border-top: 1px solid rgba(255,255,255,0.2);
}

.forecast-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(2px, 0.5vw, 4px);
  font-size: clamp(8px, 1.3vw, 10px);
}

/* Metrics */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(6px, 1.5vw, 10px);
  padding: 0 clamp(12px, 3vw, 20px);
  margin-bottom: clamp(12px, 3vw, 24px);
}

.metric-card {
  background: var(--surface);
  border-radius: clamp(10px, 2vw, 14px);
  padding: clamp(8px, 2vw, 14px) clamp(4px, 1vw, 8px);
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.metric-icon {
  font-size: clamp(14px, 3vw, 20px);
  display: block;
  margin-bottom: clamp(3px, 0.8vw, 6px);
}

.metric-value {
  font-size: clamp(11px, 2vw, 16px);
  font-weight: 700;
  display: block;
}

.metric-label {
  font-size: clamp(7px, 1.2vw, 9px);
  color: var(--text-muted);
}

/* Section Title */
.section-title {
  font-size: clamp(12px, 2.5vw, 16px);
  font-weight: 700;
  padding: 0 clamp(12px, 3vw, 20px);
  margin-bottom: clamp(8px, 2vw, 12px);
}

/* Actions */
.actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(6px, 1.5vw, 10px);
  padding: 0 clamp(12px, 3vw, 20px);
  margin-bottom: clamp(12px, 3vw, 24px);
}

.action-card {
  background: var(--surface);
  border-radius: clamp(10px, 2vw, 14px);
  padding: clamp(10px, 2.5vw, 16px);
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: transform 0.2s;
}

.action-card:hover {
  transform: translateY(-2px);
}

.action-icon {
  font-size: clamp(16px, 4vw, 24px);
  display: block;
  margin-bottom: clamp(4px, 1vw, 8px);
}

.action-card span:last-child {
  font-size: clamp(9px, 1.5vw, 12px);
  font-weight: 600;
}

/* Alerts */
.alerts-list {
  padding: 0 clamp(12px, 3vw, 20px);
}

.alert-card {
  background: var(--surface);
  border-radius: clamp(10px, 2vw, 14px);
  padding: clamp(10px, 2vw, 14px);
  display: flex;
  gap: clamp(8px, 2vw, 12px);
  margin-bottom: clamp(6px, 1.5vw, 10px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.alert-card.warning {
  border-left: 4px solid var(--warning);
}

.alert-card.info {
  border-left: 4px solid var(--info);
}

.alert-icon {
  font-size: clamp(16px, 4vw, 24px);
}

.alert-info strong {
  font-size: clamp(10px, 1.8vw, 13px);
  display: block;
  margin-bottom: clamp(2px, 0.5vw, 4px);
}

.alert-info p {
  font-size: clamp(9px, 1.4vw, 11px);
  color: var(--text-muted);
  margin-bottom: clamp(2px, 0.5vw, 4px);
}

.alert-time {
  font-size: clamp(8px, 1.2vw, 10px);
  color: var(--text-muted);
}

/* Map */
.map-container {
  padding: 0 clamp(12px, 3vw, 20px);
}

.map-placeholder {
  height: clamp(150px, 40vw, 300px);
  background: linear-gradient(135deg, #e0f2fe, #dbeafe);
  border-radius: clamp(12px, 2.5vw, 16px);
  position: relative;
  overflow: hidden;
}

.map-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(59,130,246,0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,0.1) 1px, transparent 1px);
  background-size: clamp(15px, 4vw, 30px) clamp(15px, 4vw, 30px);
}

.map-marker {
  position: absolute;
  font-size: clamp(16px, 4vw, 24px);
  transform: translate(-50%, -50%);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.2); }
}

.map-legend {
  display: flex;
  justify-content: center;
  gap: clamp(8px, 2vw, 16px);
  margin-top: clamp(8px, 2vw, 12px);
  font-size: clamp(9px, 1.4vw, 11px);
}

.map-legend i {
  width: clamp(6px, 1.5vw, 10px);
  height: clamp(6px, 1.5vw, 10px);
  border-radius: 50%;
  display: inline-block;
  margin-right: clamp(2px, 0.5vw, 4px);
}

.map-legend i.flood { background: var(--info); }
.map-legend i.quake { background: var(--danger); }
.map-legend i.safe { background: var(--success); }

/* Chat */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100% - 60px);
  padding: 0 clamp(12px, 3vw, 20px);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding-bottom: clamp(8px, 2vw, 16px);
}

.message {
  display: flex;
  gap: clamp(6px, 1.5vw, 10px);
  margin-bottom: clamp(10px, 2.5vw, 16px);
}

.message.user {
  flex-direction: row-reverse;
}

.avatar {
  width: clamp(24px, 5vw, 32px);
  height: clamp(24px, 5vw, 32px);
  background: var(--surface);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(12px, 2.5vw, 16px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  flex-shrink: 0;
}

.bubble {
  max-width: 70%;
  padding: clamp(8px, 2vw, 12px) clamp(10px, 2.5vw, 16px);
  border-radius: clamp(12px, 2.5vw, 16px);
  font-size: clamp(10px, 1.8vw, 13px);
  line-height: 1.4;
}

.message.bot .bubble {
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.message.user .bubble {
  background: var(--primary);
  color: white;
}

.chat-input {
  display: flex;
  gap: clamp(6px, 1.5vw, 10px);
  padding: clamp(8px, 2vw, 12px) 0;
}

.chat-input input {
  flex: 1;
  padding: clamp(8px, 2vw, 12px) clamp(10px, 2.5vw, 16px);
  border: 1px solid #e2e8f0;
  border-radius: clamp(8px, 2vw, 12px);
  font-size: clamp(10px, 1.8vw, 13px);
}

.chat-input button {
  padding: clamp(8px, 2vw, 12px) clamp(12px, 3vw, 20px);
  background: var(--primary);
  color: white;
  border: none;
  border-radius: clamp(8px, 2vw, 12px);
  font-weight: 600;
  cursor: pointer;
  font-size: clamp(10px, 1.8vw, 13px);
}

/* Community */
.community-feed {
  padding: 0 clamp(12px, 3vw, 20px);
}

.post {
  background: var(--surface);
  border-radius: clamp(12px, 2.5vw, 16px);
  padding: clamp(10px, 2.5vw, 16px);
  margin-bottom: clamp(8px, 2vw, 12px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.post-header {
  display: flex;
  gap: clamp(6px, 1.5vw, 10px);
  margin-bottom: clamp(8px, 2vw, 12px);
}

.post-avatar {
  width: clamp(28px, 6vw, 36px);
  height: clamp(28px, 6vw, 36px);
  background: #f1f5f9;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(12px, 2.5vw, 16px);
  flex-shrink: 0;
}

.post-header strong {
  font-size: clamp(10px, 1.8vw, 13px);
  display: block;
}

.post-time {
  font-size: clamp(9px, 1.4vw, 11px);
  color: var(--text-muted);
}

.post p {
  font-size: clamp(10px, 1.8vw, 13px);
  line-height: 1.5;
  margin-bottom: clamp(8px, 2vw, 12px);
}

.post-actions {
  display: flex;
  gap: clamp(10px, 2.5vw, 16px);
  font-size: clamp(10px, 1.6vw, 12px);
  color: var(--text-muted);
}

/* Report Form */
.report-form {
  padding: 0 clamp(12px, 3vw, 20px);
}

.form-group {
  margin-bottom: clamp(10px, 2.5vw, 16px);
}

.form-group label {
  display: block;
  font-size: clamp(10px, 1.6vw, 12px);
  font-weight: 600;
  margin-bottom: clamp(4px, 1vw, 8px);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: clamp(8px, 2vw, 12px) clamp(10px, 2.5vw, 16px);
  border: 1px solid #e2e8f0;
  border-radius: clamp(8px, 2vw, 12px);
  font-size: clamp(10px, 1.8vw, 13px);
  background: var(--surface);
}

.form-group textarea {
  min-height: clamp(60px, 15vw, 100px);
  resize: vertical;
}

.severity-options {
  display: flex;
  gap: clamp(6px, 1.5vw, 10px);
}

.severity {
  flex: 1;
  padding: clamp(6px, 1.5vw, 10px);
  border: 1px solid #e2e8f0;
  border-radius: clamp(6px, 1.5vw, 10px);
  background: var(--surface);
  font-size: clamp(10px, 1.6vw, 12px);
  font-weight: 600;
  cursor: pointer;
}

.severity.low { color: var(--success); }
.severity.medium { color: var(--warning); }
.severity.high { color: var(--danger); }

.severity.active {
  background: var(--warning);
  color: white;
  border-color: var(--warning);
}

.submit-btn {
  width: 100%;
  padding: clamp(10px, 2.5vw, 14px);
  background: var(--primary);
  color: white;
  border: none;
  border-radius: clamp(8px, 2vw, 12px);
  font-size: clamp(11px, 2vw, 14px);
  font-weight: 600;
  cursor: pointer;
  margin-top: clamp(4px, 1vw, 8px);
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  display: flex;
  justify-content: space-around;
  padding: clamp(6px, 1.5vw, 10px) 0;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(2px, 0.5vw, 4px);
  background: none;
  border: none;
  cursor: pointer;
  padding: clamp(4px, 1vw, 8px) clamp(8px, 2vw, 16px);
  border-radius: clamp(8px, 2vw, 12px);
  transition: all 0.2s;
}

.nav-btn.active {
  background: rgba(99, 102, 241, 0.1);
}

.nav-icon {
  font-size: clamp(14px, 3vw, 20px);
}

.nav-btn span:last-child {
  font-size: clamp(8px, 1.3vw, 10px);
  color: var(--text-muted);
}

.nav-btn.active span:last-child {
  color: var(--primary);
  font-weight: 600;
}

@media (max-width: 400px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
}