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

:root {
  --color-primary: #4193a6;
  --color-secondary: #38a6a6;
  --color-accent: #93bbbf;
  --color-sand: #f2e6d0;
  --color-sand-dark: #d9ceba;
  --color-white: #ffffff;
  --color-text: #1a1a1a;
  --color-text-light: #666666;
  --color-red: #ef4444;
  --color-yellow: #eab308;
  --color-green: #22c55e;
  --shadow-sm: 0 2px 8px rgba(65, 147, 166, 0.08);
  --shadow-md: 0 4px 16px rgba(65, 147, 166, 0.12);
  --shadow-lg: 0 8px 32px rgba(65, 147, 166, 0.16);
}

body {
  font-family: "Poppins", sans-serif;
  background: linear-gradient(135deg, var(--color-sand) 0%, var(--color-white) 100%);
  color: var(--color-text);
  overflow-x: hidden;
  min-height: 100vh;
}

/* Splash Screen */
#splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.5s ease;
}

#splash-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.splash-content {
  text-align: center;
  color: var(--color-white);
}

.logo-container {
  margin-bottom: 2rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

.app-logo {
  width: 120px;
  height: 120px;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.2));
}

.splash-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.splash-subtitle {
  font-size: 1.1rem;
  font-weight: 400;
  opacity: 0.9;
  margin-bottom: 3rem;
}

.wave-loader {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.wave {
  width: 12px;
  height: 12px;
  background: var(--color-white);
  border-radius: 50%;
  animation: wave 1.2s ease-in-out infinite;
}

.wave:nth-child(2) {
  animation-delay: 0.2s;
}

.wave:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes wave {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.5);
    opacity: 0.5;
  }
}

/* App Container */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--color-white);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
  position: relative;
  padding-bottom: 80px;
}

/* Header */
.app-header {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  padding: 1rem 1.5rem;
  color: var(--color-white);
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-logo {
  width: 40px;
  height: 40px;
}

.header-title {
  font-size: 1.25rem;
  font-weight: 600;
  flex: 1;
}

.notification-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-white);
  position: relative;
  transition: all 0.3s ease;
}

.notification-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.notification-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--color-red);
  color: var(--color-white);
  font-size: 0.7rem;
  font-weight: 600;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--color-primary);
}

/* Screen Management */
.screen {
  display: none;
  animation: slideIn 0.3s ease;
}

.screen.active {
  display: block;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.screen-content {
  padding: 1.5rem;
}

.screen-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.screen-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text);
}

.back-btn {
  background: var(--color-sand);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-primary);
  transition: all 0.3s ease;
}

.back-btn:hover {
  background: var(--color-sand-dark);
  transform: scale(1.05);
}

/* Home Screen */
.alert-status-card {
  background: linear-gradient(135deg, var(--color-green) 0%, #16a34a 100%);
  padding: 1.5rem;
  border-radius: 20px;
  color: var(--color-white);
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}

.status-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.status-info h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.status-info p {
  font-size: 0.9rem;
  opacity: 0.9;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.action-card {
  background: var(--color-white);
  border: 2px solid var(--color-sand);
  padding: 1.5rem 1rem;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.action-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.action-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-card span {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
}

.recent-alerts h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--color-text);
}

.alert-item {
  background: var(--color-white);
  border: 2px solid var(--color-sand);
  padding: 1rem;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
  transition: all 0.3s ease;
}

.alert-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

.alert-item-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--color-sand);
}

.alert-item-content h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--color-text);
}

.alert-item-content p {
  font-size: 0.85rem;
  color: var(--color-text-light);
}

/* Alerts Screen */
.filter-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.filter-tab {
  background: var(--color-white);
  border: 2px solid var(--color-sand);
  padding: 0.5rem 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s ease;
  color: var(--color-text);
}

.filter-tab:hover {
  border-color: var(--color-primary);
}

.filter-tab.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
}

.alerts-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.alert-card {
  background: var(--color-white);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

.alert-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.alert-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.alert-badge {
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-red {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-red);
}

.badge-yellow {
  background: rgba(234, 179, 8, 0.15);
  color: var(--color-yellow);
}

.badge-green {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-green);
}

.alert-time {
  font-size: 0.85rem;
  color: var(--color-text-light);
}

.alert-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.alert-card p {
  font-size: 0.9rem;
  color: var(--color-text-light);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.alert-location {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-text-light);
}

.alert-card.alert-red {
  border-left: 4px solid var(--color-red);
}

.alert-card.alert-yellow {
  border-left: 4px solid var(--color-yellow);
}

.alert-card.alert-green {
  border-left: 4px solid var(--color-green);
}

/* Map Screen */
.map-container {
  background: var(--color-white);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
}

.map-placeholder {
  width: 100%;
  height: 300px;
  position: relative;
}

.map-pin {
  animation: pulse 2s ease-in-out infinite;
  cursor: pointer;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.map-legend {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--color-sand);
  border-top: 1px solid var(--color-sand-dark);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--color-text);
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

.map-info-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.info-card {
  background: var(--color-white);
  border: 2px solid var(--color-sand);
  padding: 1rem;
  border-radius: 16px;
}

.info-card h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.info-status {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  display: inline-block;
}

.status-red {
  background: rgba(239, 68, 68, 0.15);
  color: var(--color-red);
}

.status-yellow {
  background: rgba(234, 179, 8, 0.15);
  color: var(--color-yellow);
}

/* Community Screen */
.community-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  padding: 1.5rem;
  border-radius: 16px;
  text-align: center;
  color: var(--color-white);
  box-shadow: var(--shadow-md);
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.85rem;
  opacity: 0.9;
}

.message-input-container {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.message-input {
  flex: 1;
  padding: 1rem;
  border: 2px solid var(--color-sand);
  border-radius: 16px;
  font-family: "Poppins", sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s ease;
}

.message-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(65, 147, 166, 0.1);
}

.send-btn {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-white);
  transition: all 0.3s ease;
}

.send-btn:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.messages-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.message-card {
  background: var(--color-white);
  border: 2px solid var(--color-sand);
  padding: 1rem;
  border-radius: 16px;
  display: flex;
  gap: 1rem;
  transition: all 0.3s ease;
}

.message-card:hover {
  box-shadow: var(--shadow-sm);
}

.message-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  font-weight: 600;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.message-content {
  flex: 1;
}

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.message-author {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text);
}

.message-time {
  font-size: 0.8rem;
  color: var(--color-text-light);
}

.message-content p {
  font-size: 0.9rem;
  color: var(--color-text);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.message-actions {
  display: flex;
  gap: 1rem;
}

.message-action {
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  color: var(--color-text-light);
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.message-action:hover {
  color: var(--color-primary);
}

/* Safety Tips Screen */
.emergency-card {
  background: linear-gradient(135deg, var(--color-red) 0%, #dc2626 100%);
  padding: 1.5rem;
  border-radius: 20px;
  color: var(--color-white);
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}

.emergency-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.emergency-contacts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.emergency-btn {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: none;
  padding: 1rem 0.5rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--color-white);
  text-decoration: none;
  transition: all 0.3s ease;
}

.emergency-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.emergency-label {
  font-size: 0.75rem;
  opacity: 0.9;
}

.emergency-number {
  font-size: 1.1rem;
  font-weight: 700;
}

.tips-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tip-card {
  background: var(--color-white);
  border: 2px solid var(--color-sand);
  padding: 1.5rem;
  border-radius: 20px;
  display: flex;
  gap: 1rem;
  transition: all 0.3s ease;
}

.tip-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.tip-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.tip-content h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

.tip-content ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tip-content li {
  font-size: 0.9rem;
  color: var(--color-text-light);
  padding-left: 1.5rem;
  position: relative;
  line-height: 1.5;
}

.tip-content li::before {
  content: "•";
  position: absolute;
  left: 0.5rem;
  color: var(--color-primary);
  font-weight: 700;
}

/* Profile Screen */
.profile-header {
  text-align: center;
  padding: 2rem 0;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--color-sand);
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: var(--color-white);
}

.profile-header h3 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--color-text);
}

.profile-header p {
  font-size: 0.9rem;
  color: var(--color-text-light);
}

.settings-section {
  margin-bottom: 2rem;
}

.settings-section h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--color-text);
}

.setting-item {
  background: var(--color-white);
  border: 2px solid var(--color-sand);
  padding: 1rem;
  border-radius: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  transition: all 0.3s ease;
}

.setting-item:hover {
  box-shadow: var(--shadow-sm);
}

.setting-info {
  flex: 1;
}

.setting-label {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: var(--color-text);
}

.setting-description {
  font-size: 0.85rem;
  color: var(--color-text-light);
}

.toggle-switch {
  position: relative;
  width: 52px;
  height: 28px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-sand);
  border-radius: 14px;
  transition: all 0.3s ease;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background: var(--color-white);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--color-primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(24px);
}

.setting-action {
  background: none;
  border: none;
  color: var(--color-text-light);
  cursor: pointer;
  transition: all 0.3s ease;
}

.setting-action:hover {
  color: var(--color-primary);
}

.logout-btn {
  width: 100%;
  padding: 1rem;
  background: var(--color-white);
  border: 2px solid var(--color-red);
  color: var(--color-red);
  font-size: 1rem;
  font-weight: 600;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: "Poppins", sans-serif;
}

.logout-btn:hover {
  background: var(--color-red);
  color: var(--color-white);
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  max-width: 480px;
  width: 100%;
  background: var(--color-white);
  border-top: 2px solid var(--color-sand);
  display: flex;
  justify-content: space-around;
  padding: 0.75rem 0;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  z-index: 100;
}

.nav-item {
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  color: var(--color-text-light);
  transition: all 0.3s ease;
  padding: 0.5rem 1rem;
  border-radius: 12px;
}

.nav-item:hover {
  background: var(--color-sand);
}

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

.nav-item span {
  font-size: 0.75rem;
  font-weight: 500;
}

/* Responsive */
@media (max-width: 480px) {
  .app-container {
    max-width: 100%;
  }

  .bottom-nav {
    max-width: 100%;
  }

  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }

  .emergency-contacts {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 360px) {
  .splash-title {
    font-size: 2rem;
  }

  .header-title {
    font-size: 1.1rem;
  }

  .nav-item span {
    font-size: 0.7rem;
  }
}
