/* Alerts Page Styles */

.alerts-main {
  flex: 1;
  width: 100%;
  /* Increased max-width to give more horizontal space on large screens */
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.alerts-content {
  background: rgba(18, 18, 18, 0.9);
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  transition: background var(--transition-base), box-shadow var(--transition-base);
}

html.light .alerts-content {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  background: rgba(26, 35, 50, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 1px rgba(56, 189, 248, 0.3);
  border: 1px solid rgba(56, 189, 248, 0.2);
  transition: all 0.3s ease;
}

/* Moved from inline <style> in alerts.html: search dropdown and button styling */
.search-dropdown { 
  font-family: 'Inter', sans-serif; 
  display: none; /* Hidden by default, controlled by JS */
}
.search-results { margin-top: 0.25rem; max-height: 240px; overflow:auto; }
.search-results .loading,
.search-results .no-results,
.search-results .error {
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
  color: #e6f6ff;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  margin-bottom: 0.25rem;
}
.search-results .result-item {
  display:block !important;
  width:100%;
  text-align:left;
  padding:0.6rem 0.75rem;
  border: 2px solid rgba(56, 189, 248, 0.5) !important;
  background: rgba(56, 189, 248, 0.1) !important;
  color:#ffffff !important;
  cursor:pointer;
  font-size: 0.95rem;
  border-radius: 8px;
  margin-bottom: 0.25rem;
  transition: all 0.2s ease;
  /* Force visibility for debugging */
  opacity: 1 !important;
  visibility: visible !important;
  min-height: 40px;
}
.search-results .result-item:hover,
.search-results .result-item:focus {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  outline: none;
  transform: translateX(4px);
}

#alertsSearchBtn {
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  color: #0a0e1a;
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.3);
}

#alertsSearchBtn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.5);
}

#alertsSearchBtn:active {
  transform: scale(0.98);
}

/* Hide canvas by default (moved from inline) */
#auroraBG { display: none; }

/* Header/title subtitle styles moved from inline */
.alerts-header { text-align: center; padding: 40px 20px; }
.alerts-title { margin-bottom: 16px; font-weight: 700; font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -0.025em; background: linear-gradient(135deg, #38bdf8, #818cf8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1.2; }
.alerts-subtitle { font-weight: 400; font-size: clamp(1rem, 2.5vw, 1.25rem); color: #94a3b8; max-width: 600px; margin: 0 auto; line-height: 1.5; }

/* Ensure alerts-content uses the full width of .alerts-main (visual parity with bottom strip) */
.alerts-content {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.alerts-content:hover {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 20px rgba(56, 189, 248, 0.2);
}

/* Alert Info Section */
.alert-info {
  text-align: center;
  margin-bottom: 40px;
  padding: 30px;
  background: rgba(0, 26, 51, 0.5);
  border-radius: 10px;
  border: 1px solid rgba(68, 218, 255, 0.2);
  transition: background var(--transition-base), border-color var(--transition-base);
}

html.light .alert-info {
  background: rgba(241, 245, 249, 0.8);
  border: 1px solid rgba(2, 132, 199, 0.3);
}

.alert-icon {
  font-size: 64px;
  margin-bottom: 20px;
  animation: bellRing 2s ease-in-out infinite;
}

@keyframes bellRing {
  0%, 100% {
    transform: rotate(0deg);
  }
  10%, 30% {
    transform: rotate(-15deg);
  }
  20%, 40% {
    transform: rotate(15deg);
  }
  50% {
    transform: rotate(0deg);
  }
}

.alert-info h2 {
  color: #44daff;
  font-size: 28px;
  margin-bottom: 15px;
  transition: color var(--transition-base);
}

html.light .alert-info h2 {
  color: #0284c7;
}

.alert-info p {
  color: #88e0ff;
  font-size: 16px;
  line-height: 1.8;
  max-width: 700px;
  margin: 0 auto;
  transition: color var(--transition-base);
}

html.light .alert-info p {
  color: #475569;
}

/* Signup Form */
.signup-section {
  margin-bottom: 50px;
}

.signup-form {
  background: rgba(0, 26, 51, 0.5);
  padding: 30px;
  border-radius: 10px;
  border: 1px solid rgba(68, 218, 255, 0.2);
  transition: background var(--transition-base), border-color var(--transition-base);
}

html.light .signup-form {
  background: rgba(241, 245, 249, 0.8);
  border: 1px solid rgba(2, 132, 199, 0.3);
}

.signup-form h3 {
  color: #44daff;
  font-size: 24px;
  margin-bottom: 25px;
  text-align: center;
  transition: color var(--transition-base);
}

html.light .signup-form h3 {
  color: #0284c7;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  color: #44daff;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  transition: color var(--transition-base);
}

html.light .form-group label {
  color: #0284c7;
  color: var(--color-accent-primary, #44daff);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.01em;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group select {
  width: 100%;
  padding: 14px 18px;
  background: rgba(10, 14, 26, 0.6);
  border: 2px solid rgba(56, 189, 248, 0.3);
  border-radius: 10px;
  color: var(--color-text-primary, #e0f2fe);
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s ease;
}

html.light .form-group input[type="text"],
html.light .form-group input[type="email"],
html.light .form-group input[type="number"],
html.light .form-group select {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(2, 132, 199, 0.3);
  color: #0f172a;
}
.form-group input::placeholder {
  color: #9aa6b2; /* light grey-blue */
  font-style: italic;
  opacity: 1; /* ensure consistent appearance across browsers */
}

/* Remove native number input spinners (up/down) for latitude/longitude inputs */
input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield; /* Firefox */
}

/* Chrome, Safari, Edge */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Ensure readonly number inputs still look selectable but without spinners */
input[type="number"][readonly] {
  cursor: text;
}

/* Lock lat/lon inputs visually and behaviorally */
input[type="number"][readonly] {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  caret-color: transparent; /* hide caret */
  outline: none; /* remove focus ring */
  /* dim the text to indicate non-editable / informational state */
  color: var(--color-text-secondary, #94a3b8);
  opacity: 0.95;
}

/* Make sure they don't accidentally receive focus via script or keyboard */
input[type="number"][readonly]:focus {
  outline: none;
  box-shadow: none;
}

/* Location input wrapper for search and button */
.location-input-wrapper {
  display: flex;
  flex-direction: row;
  gap: 12px;
  width: 100%;
  align-items: flex-start;
}

/* Inline search container: ensure the text input flexes to fill available space next to the button */
.search-container-inline {
  display: flex; /* prefer flex over inline-flex for consistent sizing */
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.search-container-inline { position: relative; }
.search-container-inline button {
  flex: 0 0 auto;
}
.search-container-inline button#alertsSearchBtn,
.search-container-inline button {
  /* give the button a stable width so the dropdown can calculate remaining space */
  width: 48px;
  height: 44px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.search-container-inline .search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  /* Since there's no button in alerts.html, dropdown should start from the left edge */
  left: 0;
  right: 0;
  width: auto;
  max-width: none;
  background: #1a2332 !important;
  border: 2px solid rgba(56, 189, 248, 0.8) !important;
  padding: 12px;
  border-radius: 6px;
  z-index: 9999 !important;
  max-height: 320px;
  min-height: 80px;
  overflow: visible !important;
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.4) !important;
  /* Force visibility */
  opacity: 1 !important;
  visibility: visible !important;
}
.search-container-inline button {
  flex: 0 0 auto;
}
.search-container-inline input[type="text"] {
  flex: 1 1 auto;
  min-width: 0; /* prevents overflowing in flex containers */
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-accent-primary, #44daff);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
  background: rgba(10, 14, 26, 0.8);
}

html.light .form-group input:focus,
html.light .form-group select:focus {
  border-color: #0284c7;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.3);
}

.form-group small {
  display: block;
  color: #88e0ff;
  font-size: 12px;
  margin-top: 5px;
  opacity: 0.8;
  transition: color var(--transition-base);
}

html.light .form-group small {
  color: #64748b;
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--color-text-secondary, #94a3b8);
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  transition: color 0.3s ease;
}

.checkbox-group label:hover {
  color: var(--color-text-primary, #e0f2fe);
}

.checkbox-group input[type="checkbox"] {
  margin-right: 12px;
  cursor: pointer;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--color-accent-primary, #38bdf8);
}

.submit-btn {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, var(--color-accent-primary, #38bdf8), var(--color-accent-secondary, #818cf8));
  color: var(--color-bg-primary, #0a0e1a);
  font-size: 17px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.02em;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 20px;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

.submit-btn:hover {
  background: linear-gradient(135deg, var(--color-accent-glow, #7dd3fc), var(--color-accent-primary, #38bdf8));
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(56, 189, 248, 0.5);
}

.submit-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
}

.form-message {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: 10px;
  text-align: center;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  display: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.form-message.success {
  display: block;
  background: rgba(34, 197, 94, 0.15);
  border: 2px solid rgba(34, 197, 94, 0.6);
  color: #4ade80;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

.form-message.error {
  display: block;
  background: rgba(239, 68, 68, 0.15);
  border: 2px solid rgba(239, 68, 68, 0.6);
  color: #f87171;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* How It Works */
.how-it-works {
  margin-bottom: 50px;
  padding: 30px;
  background: rgba(0, 26, 51, 0.3);
  border-radius: 10px;
}

.how-it-works h2 {
  color: #44daff;
  font-size: 28px;
  margin-bottom: 30px;
  text-align: center;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 25px;
}

.work-item {
  text-align: center;
  padding: 20px;
  background: rgba(0, 26, 51, 0.5);
  border-radius: 8px;
  border: 1px solid rgba(68, 218, 255, 0.2);
  transition: all 0.3s ease;
}

.work-item:hover {
  transform: translateY(-5px);
  border-color: #44daff;
  box-shadow: 0 5px 15px rgba(68, 218, 255, 0.3);
}

.work-number {
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #44daff, #2288cc);
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: bold;
  margin: 0 auto 15px;
}

.work-item h4 {
  color: #44daff;
  font-size: 18px;
  margin-bottom: 10px;
}

.work-item p {
  color: #88e0ff;
  font-size: 14px;
  line-height: 1.6;
}

/* FAQ Section */
.faq-section {
  padding: 30px;
  background: rgba(0, 26, 51, 0.3);
  border-radius: 10px;
}

.faq-section h2 {
  color: #44daff;
  font-size: 28px;
  margin-bottom: 25px;
  text-align: center;
}

.faq-item {
  margin-bottom: 25px;
  padding: 20px;
  background: rgba(0, 26, 51, 0.5);
  border-left: 4px solid #44daff;
  border-radius: 6px;
}

.faq-item:last-child {
  margin-bottom: 0;
}

.faq-item h4 {
  color: #44daff;
  font-size: 18px;
  margin-bottom: 10px;
}

.faq-item p {
  color: #88e0ff;
  font-size: 14px;
  line-height: 1.8;
  margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .alerts-content {
    padding: 20px;
  }

  .signup-form,
  .alert-info,
  .how-it-works,
  .faq-section {
    padding: 20px;
  }

  .alert-icon {
    font-size: 48px;
  }

  .alert-info h2,
  .how-it-works h2,
  .faq-section h2 {
    font-size: 24px;
  }

  .works-grid {
    grid-template-columns: 1fr;
  }
}
/* Bottom feature boxes (normal size, horizontally spread) */
.alerts-intro-bottom {
  display: flex;
  gap: 24px;
  justify-content: space-between;
  align-items: stretch;
  margin-top: 40px;
  padding: 32px;
  background: rgba(26, 35, 50, 0.55);
  border-radius: 16px;
  border: 1px solid rgba(56, 189, 248, 0.18);
}
.alerts-intro-bottom .feature {
  flex: 1 1 0;
  min-width: 320px;
  padding: 24px;
  text-align: center;
  background: rgba(0, 26, 51, 0.4);
  border-radius: 12px;
  border: 1px solid rgba(68, 218, 255, 0.12);
}
.alerts-intro-bottom .feature .icon {
  font-size: 2.4rem;
  margin-bottom: 16px;
}
.alerts-intro-bottom .feature h4 {
  font-size: 18px;
  margin: 0 0 10px;
  color: #38bdf8;
  font-weight: 700;
}
.alerts-intro-bottom .feature p {
  color: #94a3b8;
  font-size: 15px;
  margin: 0;
}

@media (max-width: 768px) {
  .alerts-intro-bottom { flex-direction: column; padding: 20px; }
  .alerts-intro-bottom .feature { min-width: unset; padding: 16px; }
  .alerts-intro-bottom .feature .icon { font-size: 1.8rem; margin-bottom: 10px; }
  .alerts-intro-bottom .feature h4 { font-size: 15px; margin-bottom: 6px; }
  .alerts-intro-bottom .feature p { font-size: 13px; }
}

/* Threshold Slider Styling */
.threshold-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 20px;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.threshold-value {
  font-size: 48px;
  font-weight: 700;
  color: var(--color-accent-primary, #38bdf8);
  text-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
  line-height: 1;
}

.threshold-label {
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text-secondary, #94a3b8);
  text-align: center;
  line-height: 1.4;
  max-width: 400px;
}

.threshold-slider {
  width: 100%;
  height: 8px;
  border-radius: 10px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  margin: 10px 0;
  background: transparent;
}

/* Webkit (Chrome, Safari, Edge) track styling */
.threshold-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 8px;
  background: linear-gradient(to right, 
    #22c55e 0%, 
    #84cc16 25%, 
    #eab308 50%, 
    #f97316 75%, 
    #ef4444 100%);
  border-radius: 10px;
}

/* Firefox track styling */
.threshold-slider::-moz-range-track {
  width: 100%;
  height: 8px;
  background: linear-gradient(to right, 
    #22c55e 0%, 
    #84cc16 25%, 
    #eab308 50%, 
    #f97316 75%, 
    #ef4444 100%);
  border-radius: 10px;
}

.threshold-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  background: #38bdf8;
  border: 3px solid #0a0e1a;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  /* Center vertically over 8px track: -(thumbHeight - trackHeight)/2 = -(28-8)/2 = -10px */
  margin-top: -10px;
}



.threshold-slider::-moz-range-thumb {
  width: 28px;
  height: 28px;
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  border: 3px solid #0a0e1a;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  /* Firefox does not support margin-top on thumb; use translateY instead */
  transform: translateY(-1px); /* Move thumb further down for perfect centering */
}

.threshold-slider::-moz-range-thumb:hover {
  /* Preserve vertical centering, no scaling */
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.8);
}

.threshold-markers {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  padding: 0 4px;
}

.threshold-markers span {
  font-size: 13px;
  color: var(--color-text-secondary, #94a3b8);
  text-align: center;
  line-height: 1.2;
  font-weight: 500;
}

.threshold-markers small {
  display: block;
  font-size: 11px;
  color: var(--color-text-secondary, #94a3b8);
  opacity: 0.7;
  margin-top: 2px;
  font-weight: 400;
}

/* Light mode adjustments */
html.light .threshold-slider::-webkit-slider-thumb {
  border-color: #ffffff;
}

html.light .threshold-slider::-moz-range-thumb {
  border-color: #ffffff;
}

@media (max-width: 640px) {
  .threshold-value {
    font-size: 36px;
  }

  .threshold-label {
    font-size: 14px;
  }

  .threshold-markers span {
    font-size: 11px;
  }

  .threshold-markers small {
    font-size: 9px;
  }

  /* Remove conflicting mobile thumb alignment overrides. Centering is handled by calc above. */
}

/* Use My Location Button */
.use-location-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(129, 140, 248, 0.15));
  border: 2px solid rgba(56, 189, 248, 0.4);
  border-radius: 10px;
  color: var(--color-accent-primary, #38bdf8);
  font-size: 15px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
  white-space: nowrap;
  min-width: 200px;
}

.use-location-btn:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(129, 140, 248, 0.25));
  border-color: rgba(56, 189, 248, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.use-location-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(56, 189, 248, 0.2);
}

.use-location-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.use-location-btn .button-icon {
  font-size: 18px;
}

.use-location-btn .button-text {
  font-size: 15px;
}

@media (max-width: 768px) {
  .location-input-wrapper {
    flex-direction: column;
  }

  .use-location-btn {
    width: 100%;
    min-width: unset;
  }

  .search-container-inline {
    width: 100%;
  }
}