/* GLOBAL FIXES */
*, *::before, *::after {
    box-sizing: border-box; 
}

html, body {
    height: auto;
    margin: 0;
    padding: 0;
    font-family: 'Raleway', sans-serif;
    background-color: #f5f6fa;
    color: #2f3640;
    display: flex;
    flex-direction: column;
    overflow-x: hidden; 
}

/* NAVBAR */
.navbar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    padding: 1rem;
    width: 100%;
    background-color: #2f3640;
    position: relative;
    z-index: 10;
}

/* Desktop links (always visible) */
.nav-links {
    display: flex;
    gap: 2rem;
    margin: 0 auto;
}

/* Desktop link styles */
.nav-links a {
    color: #f5f6fa;
    font-weight: bold;
    font-size: 1.1rem;
    text-decoration: none;
}
.nav-links a:hover {
    color: #00a8ff;
}

/* Hamburger toggle (hidden on desktop) */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #f5f6fa;
    cursor: pointer;
}

/* GLOBAL LINKS */
a {
    color: #66ffcc;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* MAIN CONTENT */
main {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 1rem;
    padding-bottom: 1rem;
    padding-left: 0;  
    padding-right: 0;
}

/* PLOTS & MAP */
#history-plot,
#overview-plot,
#geo-map {
    width: 100%;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    background: #fff;
    border-radius: 10px;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

#scenarios {
    width: 90%;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 1rem;
    background: #fff;
    border-radius: 10px;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

#scenario-summary {
    margin-left: 1rem;
    margin-right: 1rem;
}

.scenario-tag {
  cursor: help;
  color: #555;
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-block;
  padding: 2px 6px;
  background: #e9ecef;
  border-radius: 4px;
}

.scenario-tag:hover {
  background: #dee2e6;
}

/* Plot heights */
#history-plot {
    height: 500px;
    margin-top: 1.4rem;
    margin-bottom: 2rem;
}
#overview-plot {
    height: 400px;
    margin-top: 1rem;
    margin-bottom: 2rem;
}

/* Map container */
#geo-map {
    width: 100%;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    height: auto;
    min-height: unset;
    padding: 0;
    box-sizing: border-box;
}

/* Plotly containers */
#geo-map .plot-container,
#geo-map .js-plotly-plot,
#overview-plot .plot-container,
#overview-plot .js-plotly-plot {
    height: auto !important;
    max-height: 80vh;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* FOOTER */
footer {
    flex-shrink: 0;
    text-align: center;
    padding: 1rem 0;
    font-size: 0.9rem;
    color: #7f8c8d;
    border-top: 1px solid #dcdde1;
}

/* MOBILE (<768px) */
@media (max-width: 768px) {
    .navbar {
        justify-content: space-between;
    }

    .nav-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: #2f3640;
        padding: 0.75rem 1rem;
        border-radius: 0 0 8px 8px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.2);
        gap: 0.75rem;
        width: 100%;
        z-index: 9;
    }

    .nav-links.show {
        display: flex;
    }

    .nav-links a {
        padding: 0.5rem 0;
    }

    .summary {
      text-align: center;
      margin-left: auto;
      margin-right: auto;
      padding-left: env(safe-area-inset-left);
      padding-right: env(safe-area-inset-right);
    }

    main {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    #overview-plot,
    #history-plot {
        height: 400px;
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    #overview-plot {
        padding: 0;
        max-width: calc(100% - 1rem);
        overflow-x: hidden;
    }
    #geo-map {
        height: auto;
        min-height: unset;
        aspect-ratio: 16 / 9;
        padding: 0.5rem;
        max-width: 100%;
        overflow: hidden;
    }
}

/* PULSE ANIMATION */
.pulse {
    width: 10px;
    height: 10px;
    display: inline-block;
    background-color: #4CAF50;
    border-radius: 50%;
    animation: pulse-animation 1.8s infinite;
    margin-right: 8px;
}

@keyframes pulse-animation {
    0% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.5); opacity: 1; }
    100% { transform: scale(1); opacity: 0.6; }
}
