/* ================================
   Base & Typography
   ================================ */
   :root {
    --primary-color: #0d47a1;       /* Deep navy blue */
    --secondary-color: #1976d2;     /* Lighter blue */
    --background: #001f3f;          /* Dark navy background */
    --text-color: #e0e0e0;          /* Light text */
    --header-gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --shadow-color: rgba(0, 0, 0, 0.8);
    --border-radius: 12px;
    --popup-animation-duration: 0.5s;
  }
  
  * {
    box-sizing: border-box;
  }
  
  body {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    background: var(--background);
    color: var(--text-color);
    padding-bottom: 0; /* No extra space below footer */
  }
  
  /* ================================
     Header
     ================================ */
  .dashboard-header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--header-gradient);
    color: #fff;
    box-shadow: 0 4px 20px var(--shadow-color);
    overflow: hidden;
  }
  
  .header-content h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 600;
    text-shadow: 0 2px 4px var(--shadow-color);
  }
  
  .header-content p {
    margin: 0.3rem 0 0;
    font-size: 1rem;
    opacity: 0.9;
  }
  
  /* Floating animated background for header */
  .dashboard-header::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(25,118,210,0.2), transparent 70%);
    animation: headerFloat 10s ease-in-out infinite;
    z-index: 0;
  }
  
  @keyframes headerFloat {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, 20px) scale(1.05); }
    100% { transform: translate(0, 0) scale(1); }
  }
  
  .dashboard-header * {
    position: relative;
    z-index: 1;
  }
  
  /* ================================
     Search Box
     ================================ */
  .search-box {
    display: flex;
    gap: 0.5rem;
  }
  
  #searchInput {
    padding: 0.75rem;
    border: none;
    border-radius: 30px;
    width: 250px;
    font-size: 1rem;
    box-shadow: 0 1px 4px var(--shadow-color);
    transition: box-shadow 0.3s;
  }
  
  #searchInput:focus {
    outline: none;
    box-shadow: 0 2px 10px var(--shadow-color);
  }
  
  #searchBtn {
    padding: 0.75rem 1.2rem;
    border: none;
    border-radius: 30px;
    background: var(--primary-color);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    box-shadow: 0 1px 4px var(--shadow-color);
  }
  
  #searchBtn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
  }
  
  /* ================================
     Main Layout
     ================================ */
  .dashboard-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    padding: 2rem;
  }
  
  /* ================================
     Alerts Sidebar
     ================================ */
  .alerts-section {
    background: rgba(255,255,255,0.05);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: 0 4px 20px var(--shadow-color);
    overflow: hidden;
    backdrop-filter: blur(10px);
  }
  
  .alerts-section h2 {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 1.4rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
  }
  
  .alert-list {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 0.5rem;
  }
  
  .alert-card {
    background: rgba(255,255,255,0.05);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 1px 4px var(--shadow-color);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
  }
  
  .alert-card:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 10px var(--shadow-color);
  }
  
  .alert-card.critical {
    border-left: 5px solid var(--primary-color);
  }
  
  /* ================================
     Map Section
     ================================ */
  .map-section {
    position: relative;
  }
  
  #map {
    height: 70vh;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px var(--shadow-color);
    overflow: hidden;
  }
  
  /* Floating animated overlay on map */
  #map::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(25,118,210,0.05), transparent);
    animation: mapFloat 8s ease-in-out infinite;
    pointer-events: none;
  }
  
  @keyframes mapFloat {
    0% { transform: translate(0, 0); }
    50% { transform: translate(10px, 10px); }
    100% { transform: translate(0, 0); }
  }
  
  .map-legend {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
    font-size: 0.9rem;
  }
  
  .legend-item span {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 0.3rem;
  }
  
  .quake { background: #ff6b6b; }   /* Red for earthquakes */
  
  /* ================================
     Popup / Info Window
     ================================ */
  .info-window {
    font-size: 0.9rem;
    padding: 1rem;
    border-radius: var(--border-radius);
    background: #fff;
    color: #000;
    animation: popupFadeIn var(--popup-animation-duration) ease-in-out;
    max-width: 300px;
    overflow: hidden;
  }
  
  @keyframes popupFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  /* Popup styles for earthquake alerts */
  .popup-eq {
    background: #ffe0b2;
    border: 1px solid #ff9800;
  }
  
  .info-window h3 {
    font-weight: bold;
    margin-bottom: 0.5rem;
  }
  
  .info-window p {
    margin: 0.3rem 0;
  }
  
  .country-info,
  .temperature-info {
    font-weight: bold;
    background-color: #f1f1f1;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
  }
  
  /* ================================
     Buttons in Popup
     ================================ */
  .map-btn {
    background: var(--primary-color);
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    margin: 0.5rem 0.3rem 0 0;
    cursor: pointer;
    color: #fff;
    font-size: 0.85rem;
    transition: background 0.3s;
  }
  
  .map-btn:hover {
    background: var(--secondary-color);
  }
  
  .read-more-btn {
    background: var(--primary-color);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    color: #fff;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
    font-size: 0.9rem;
    margin-top: 0.5rem;
  }
  
  .read-more-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
  }
  
  /* ================================
     Help Centers List inside Popup
     ================================ */
  .help-center-list {
    background-color: #fff;
    padding: 0.5rem;
    border-radius: 4px;
    list-style: none;
    margin: 0.5rem 0;
    color: #000;
  }
  
  .help-center-list li {
    padding: 0.25rem 0;
    border-bottom: 1px solid #ccc;
  }
  
  .help-center-list li:last-child {
    border-bottom: none;
  }
  
  /* ================================
     Loading Indicator
     ================================ */
  #loadingIndicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    color: #fff;
    z-index: 1000;
    display: none;
  }
  
  /* ================================
     Modal Styles
     ================================ */
  .modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    overflow: auto;
  }
  
  .modal-content {
    background-color: #0a192f;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid var(--primary-color);
    width: 80%;
    max-width: 600px;
    border-radius: var(--border-radius);
    color: var(--text-color);
    font-size: 0.95rem;
    max-height: 80vh;
    overflow-y: auto;
  }
  
  .close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-color);
  }
  
  .close:hover {
    color: var(--primary-color);
  }
  
  /* ================================
     Footer
     ================================ */
  footer {
    text-align: center;
    padding: 1rem;
    background: #0a192f;
    border-top: 1px solid rgba(255,255,255,0.1);
    position: relative;
    width: 100%;
    color: var(--text-color);
  }
  
  /* Ensure Leaflet Map Container has rounded corners */
  .leaflet-container {
    border-radius: var(--border-radius);
  }
  
  /* Style for the Retry button in error messages */
  .retry-btn {
    background: var(--primary-color);
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    margin-left: 10px;
    transition: background 0.3s;
  }
  
  .retry-btn:hover {
    background: var(--secondary-color);
  }
  