/* Iran Sky Alert - Iran Flag Colors */
:root {
  --green: #006233;   /* پرچم ایران - سبز */
  --white: #FFFFFF;   /* پرچم ایران - سفید */
  --red: #CE1126;     /* پرچم ایران - قرمز */
  --green-dark: #004d26;
  --red-dark: #a00d1e;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
  background: linear-gradient(180deg, var(--green) 0%, var(--white) 33%, var(--red) 66%, var(--red-dark) 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

.app {
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  background: linear-gradient(90deg, var(--green) 0%, var(--white) 50%, var(--red) 100%);
  color: var(--white);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.8);
  object-fit: cover;
}

.logo h1 {
  font-size: 1.4rem;
  font-weight: 700;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.logo-en {
  font-size: 0.8rem;
  opacity: 0.9;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.2);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 0.9rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4ade80;
  animation: pulse 2s infinite;
}

.status-badge.alert .status-dot {
  background: var(--red);
  animation: blink 0.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Alert Banner */
.alert-banner {
  display: none;
  background: linear-gradient(90deg, var(--red-dark), var(--red));
  color: white;
  padding: 16px 20px;
  font-weight: 700;
  font-size: 1.1rem;
  text-align: center;
  box-shadow: 0 4px 20px rgba(206,17,38,0.5);
}

.alert-banner.active {
  display: block;
  animation: alertPulse 1s infinite alternate;
}

@keyframes alertPulse {
  from { opacity: 1; }
  to { opacity: 0.9; }
}

.alert-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.alert-icon {
  font-size: 1.8rem;
}

.btn-mute {
  background: white;
  color: var(--red);
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
}

.btn-mute:hover {
  background: #ffe0e0;
}

/* Map */
.main {
  flex: 1;
  position: relative;
  min-height: 400px;
}

#map {
  width: 100%;
  height: calc(100vh - 280px);
  min-height: 350px;
  background: #e0e0e0;
}

.map-legend {
  position: absolute;
  bottom: 60px;
  right: 10px;
  background: rgba(255,255,255,0.95);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  display: flex;
  gap: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  z-index: 1000;
}

.legend-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-left: 4px;
  vertical-align: middle;
}

.legend-dot.safe { background: var(--green); }
.legend-dot.danger { background: var(--red); }
.legend-dot.route { background: #f59e0b; }

/* Action Buttons - Iran Flag Theme */
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  background: rgba(0,0,0,0.15);
  border-top: 2px solid rgba(255,255,255,0.3);
}

.btn-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 20px;
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: white;
  transition: transform 0.2s, box-shadow 0.2s;
  min-width: 100px;
}

.btn-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.btn-icon {
  font-size: 1.5rem;
}

.btn-red {
  background: linear-gradient(135deg, var(--red-dark), var(--red));
}

.btn-white {
  background: linear-gradient(135deg, #e5e5e5, white);
  color: #333;
  border-color: #ccc;
}

.btn-white:hover {
  background: linear-gradient(135deg, white, #f0f0f0);
}

.btn-share {
  background: linear-gradient(135deg, var(--green-dark), var(--green));
}

.btn-green {
  background: linear-gradient(135deg, #059669, #10b981);
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 16px;
  padding: 24px;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  border: 3px solid var(--green);
}

.modal-content h2 {
  color: var(--green);
  margin-bottom: 16px;
  font-size: 1.4rem;
}

.modal-content p {
  margin-bottom: 12px;
  line-height: 1.8;
}

.modal-close {
  position: absolute;
  top: 12px;
  left: 12px;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #666;
}

.modal-close:hover {
  color: var(--red);
}

.alerts-list {
  margin-top: 12px;
}

.alert-item {
  background: #f8f8f8;
  border-right: 4px solid var(--red);
  padding: 14px;
  margin-bottom: 12px;
  border-radius: 8px;
}

.alert-item .account {
  font-weight: 700;
  color: var(--green);
  margin-bottom: 6px;
}

.alert-item .text {
  margin-bottom: 6px;
}

.alert-item .time {
  font-size: 0.85rem;
  color: #666;
}

.no-alerts {
  color: #888;
  text-align: center;
  padding: 24px;
}

/* Leaflet overrides for RTL */
.leaflet-container {
  font-family: inherit;
}

@media (max-width: 600px) {
  .header {
    flex-direction: column;
  }

  .logo h1 {
    font-size: 1.2rem;
  }

  .action-buttons {
    flex-direction: column;
  }

  .btn-action {
    width: 100%;
  }
}
