:root {
    /* Color Palette */
    --bg-dark: #0a0b10;
    --text-main: #f0f2f5;
    --text-muted: #a0a6b5;

    --accent-neon: #ffcc00;
    /* Yellow representing the corona */
    --accent-hover: #ff9900;
    --danger: #ff4757;

    --glass-bg: rgba(18, 20, 28, 0.65);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

    /* Typography */
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Animations */
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: var(--font-main);
    color: var(--text-main);
    background-color: var(--bg-dark);
    overflow: hidden;
    /* App-like feel */
    -webkit-font-smoothing: antialiased;
}

/* --- Map --- */
#map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

/* Custom leaflet shadow style */
.leaflet-interactive {
    transition: fill-opacity 0.2s;
}

/* --- UI Overlay --- */
.ui-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    /* Let clicks pass through to map by default */
    display: flex;
    flex-direction: column;
    padding: clamp(1rem, 3vw, 2rem);
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    box-shadow: var(--glass-shadow);
    pointer-events: auto;
    /* Enable clicks on panels */
}

/* --- Utilities --- */
.hidden {
    display: none !important;
}

/* --- Header & Search --- */
.main-header {
    position: relative;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.75rem 1.5rem;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.main-header:focus-within {
    z-index: 300;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.logo i {
    font-size: 1.5rem;
    color: var(--accent-neon);
    filter: drop-shadow(0 0 8px rgba(255, 204, 0, 0.6));
}

.logo h1 {
    font-size: 1.25rem;
    font-weight: 300;
}

.logo strong {
    font-weight: 700;
}

.search-container {
    flex: 1;
    position: relative;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper .location-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
}

.search-input-wrapper .loading-icon {
    position: absolute;
    right: 1rem;
    color: var(--accent-neon);
}

#search-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-family: var(--font-main);
    font-size: 1rem;
    padding: 0.75rem 2.5rem;
    border-radius: 100px;
    outline: none;
    transition: var(--transition);
}

#search-input:focus {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.15);
}

.btn-location {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
    transition: var(--transition);
}

.btn-location:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--accent-neon);
    transform: scale(1.05);
}

.btn-location.active {
    background: rgba(255, 204, 0, 0.2);
    color: var(--accent-neon);
    border-color: rgba(255, 204, 0, 0.4);
}

.header-controls {
    display: flex;
    gap: 0.5rem;
}

.mobile-menu-btn {
    display: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    place-items: center;
    font-size: 1.1rem;
    transition: var(--transition);
}

.mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--accent-neon);
}

/* POI custom markers */
.poi-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(18, 20, 28, 0.85);
    border: 2px solid var(--accent-neon);
    color: var(--accent-neon);
    font-size: 0.8rem;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.poi-marker:hover {
    transform: scale(1.2);
    box-shadow: 0 0 16px rgba(255, 204, 0, 0.6);
}

/* Leaflet popup dark theme */
.poi-popup .leaflet-popup-content-wrapper {
    background: rgba(18, 20, 28, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    color: var(--text-main);
    font-family: var(--font-main);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.poi-popup .leaflet-popup-content {
    margin: 0.75rem 1rem;
    line-height: 1.5;
}

.poi-popup .leaflet-popup-tip {
    background: rgba(18, 20, 28, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.poi-popup .leaflet-popup-close-button {
    color: var(--text-muted);
}

.poi-popup .leaflet-popup-close-button:hover {
    color: var(--accent-neon);
}

.poi-popup-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--accent-neon);
}

.poi-popup-type {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.poi-popup-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.poi-popup-btn {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: 100px;
    background: rgba(255, 204, 0, 0.15);
    color: var(--accent-neon);
    border: 1px solid rgba(255, 204, 0, 0.3);
    font-size: 0.75rem;
    font-family: var(--font-main);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.poi-popup-btn:hover {
    background: rgba(255, 204, 0, 0.25);
}

.search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    overflow: hidden;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

.search-result-item {
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.res-name {
    font-weight: 500;
    font-size: 1rem;
}

.res-context {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* --- Countdown Badge --- */
.countdown-badge {
    position: absolute;
    top: 5.5rem;
    right: clamp(1rem, 3vw, 2rem);
    padding: 0.6rem 1.2rem;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    font-weight: 500;
    pointer-events: auto;
    animation: pulseGlow 3s ease-in-out infinite, fadeInDown 0.8s ease-out;
    z-index: 11;
    border: 1px solid rgba(255, 204, 0, 0.15);
}

.countdown-badge i {
    color: var(--accent-neon);
    filter: drop-shadow(0 0 4px rgba(255, 204, 0, 0.5));
}

.countdown-badge .cd-number {
    font-weight: 700;
    color: var(--accent-neon);
    font-variant-numeric: tabular-nums;
}

.countdown-badge .cd-unit {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.8em;
    margin-right: 0.15em;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: var(--glass-shadow);
    }

    50% {
        box-shadow: var(--glass-shadow), 0 0 12px 2px rgba(255, 204, 0, 0.08);
    }
}

/* --- Shadow Animation Controls --- */
.shadow-controls {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.6rem 1rem;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 12;
    min-width: 360px;
    pointer-events: auto;
    animation: fadeInDown 0.4s ease-out;
}

.shadow-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 0.85rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.shadow-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--accent-neon);
}

.shadow-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.15);
    outline: none;
    cursor: pointer;
}

.shadow-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-neon);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(255, 204, 0, 0.5);
}

.shadow-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-neon);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 8px rgba(255, 204, 0, 0.5);
}

.shadow-time {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    min-width: 5.5em;
    text-align: center;
}

/* --- Info Panel --- */
.info-panel {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    width: calc(100% - 4rem);
    max-width: 520px;
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
    padding: 2rem;
    transform: translateY(0);
    opacity: 1;
    z-index: 200;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s;
    animation: slideUp 0.6s ease-out forwards;
}

.info-panel.hidden {
    transform: translateY(100px);
    opacity: 0;
    pointer-events: none;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    transition: var(--transition);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.info-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 0 2rem;
}

.info-header h2 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.25rem;
    word-wrap: break-word;
}

/* --- Score Badge Row (below region name) --- */
.score-badge-row {
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
}

/* --- Eclipse Observation Score Badge --- */
.eclipse-score-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: help;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
    animation: scoreAppear 0.5s ease-out;
}

@keyframes scoreAppear {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.eclipse-score-badge i {
    font-size: 0.7rem;
    filter: drop-shadow(0 0 3px currentColor);
}

.eclipse-score-badge .score-value {
    font-variant-numeric: tabular-nums;
}

.eclipse-score-badge .score-max {
    font-weight: 400;
    opacity: 0.6;
    font-size: 0.75rem;
}

/* Score color tiers */
.eclipse-score-badge.score-excellent {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.eclipse-score-badge.score-good {
    background: rgba(241, 196, 15, 0.15);
    color: #f1c40f;
    border: 1px solid rgba(241, 196, 15, 0.3);
}

.eclipse-score-badge.score-fair {
    background: rgba(230, 126, 34, 0.15);
    color: #e67e22;
    border: 1px solid rgba(230, 126, 34, 0.3);
}

.eclipse-score-badge.score-poor {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.eclipse-score-badge.score-none {
    background: rgba(99, 110, 114, 0.12);
    color: #636e72;
    border: 1px solid rgba(99, 110, 114, 0.25);
}

.eclipse-score-badge.score-none .score-max {
    display: none;
}

/* --- Score Tooltip --- */
.score-tooltip {
    display: none;
    position: fixed;
    width: 310px;
    background: rgba(14, 16, 22, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
    z-index: 10000;
    text-align: left;
    cursor: default;
    animation: tooltipFadeIn 0.25s ease-out;
    pointer-events: none;
}

.score-tooltip.visible {
    display: block;
}

@keyframes tooltipFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tooltip arrow (points upward) */
.score-tooltip::before {
    content: '';
    position: absolute;
    top: -6px;
    left: var(--arrow-left, 50%);
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: rgba(14, 16, 22, 0.96);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

/* Remove the old CSS hover trigger - JS handles it now */



.score-tooltip-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #f0f2f5;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.score-tooltip-title i {
    font-size: 0.75rem;
    color: var(--accent-neon);
    filter: none;
}

.score-tooltip-desc {
    font-size: 0.72rem;
    color: #a0a6b5;
    line-height: 1.45;
    margin-bottom: 12px;
    font-weight: 400;
}

.score-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.score-criterion {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.score-criterion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.score-criterion-label {
    font-size: 0.72rem;
    color: #ccc;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.score-criterion-label i {
    font-size: 0.65rem;
    width: 14px;
    text-align: center;
    filter: none;
}

.score-criterion-pts {
    font-size: 0.7rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #a0a6b5;
}

.score-criterion-bar {
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.score-criterion-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease-out;
}

.score-tooltip-footer {
    font-size: 0.65rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-weight: 400;
}

.score-tooltip-footer i {
    font-size: 0.6rem;
    filter: none;
}

.region-name {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.eclipse-visual-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

#eclipse-canvas {
    border-radius: 50%;
    filter: drop-shadow(0 0 12px rgba(255, 204, 0, 0.3));
}

.eclipse-summary-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.eclipse-phase-badge {
    background: rgba(255, 204, 0, 0.15);
    color: var(--accent-neon);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid rgba(255, 204, 0, 0.3);
}

.obscuration {
    text-align: center;
}

.obscuration label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.obscuration span {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.obscuration .percent {
    font-size: 1.2rem;
    margin-left: 2px;
}

.eclipse-timeline {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: start;
    background: rgba(0, 0, 0, 0.2);
    padding: 1.25rem 1rem;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    gap: 0.5rem;
}

/* When C2/C3 are hidden, collapse to 3 columns */
.eclipse-timeline:has(.total-only.hidden) {
    grid-template-columns: repeat(3, 1fr);
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    text-align: center;
}

.contact-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline-step.total-only .contact-label {
    background: rgba(255, 204, 0, 0.12);
    color: var(--accent-neon);
    border-color: rgba(255, 204, 0, 0.25);
}

.timeline-step.highlight .contact-label {
    background: rgba(255, 204, 0, 0.15);
    color: var(--accent-neon);
    border-color: rgba(255, 204, 0, 0.3);
    font-size: 0.75rem;
    filter: drop-shadow(0 0 6px rgba(255, 204, 0, 0.4));
}

.time-details {
    display: flex;
    flex-direction: column;
}

.time-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
    white-space: nowrap;
}

.time-value {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.time-value.eclipse-peak {
    color: var(--accent-neon);
    font-size: 1rem;
}

.extra-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 0.75rem;
    font-size: 0.95rem;
}

.info-item i {
    color: var(--accent-neon);
    opacity: 0.8;
}

.item-label {
    color: var(--text-muted);
    flex: 1;
}

/* Weather info */
.weather-item {
    flex-wrap: wrap;
}

.weather-item i {
    font-size: 1.1rem;
}

.weather-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.weather-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.weather-source {
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.7;
    font-style: italic;
}

.weather-good {
    color: #4cd964;
}

.weather-ok {
    color: var(--accent-neon);
}

.weather-bad {
    color: var(--danger);
}

/* Sun position */
.sun-position {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sun-compass {
    position: relative;
    width: 72px;
    height: 72px;
    flex-shrink: 0;
}

.compass-ring {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.compass-dir {
    position: absolute;
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--text-muted);
}

.compass-dir.n {
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
}

.compass-dir.s {
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
}

.compass-dir.e {
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
}

.compass-dir.w {
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
}

.compass-needle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 28px;
    background: var(--accent-neon);
    transform-origin: bottom center;
    border-radius: 1px;
    transform: translate(-50%, -100%) rotate(0deg);
    transition: transform 0.6s ease-out;
    box-shadow: 0 0 6px rgba(255, 204, 0, 0.4);
}

.compass-sun-icon {
    position: absolute;
    font-size: 0.7rem;
    color: var(--accent-neon);
    filter: drop-shadow(0 0 4px rgba(255, 204, 0, 0.6));
    transition: all 0.6s ease-out;
    pointer-events: none;
}

.sun-data {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
}

.sun-data-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.sun-data-item i {
    color: var(--accent-neon);
    opacity: 0.7;
    font-size: 0.8rem;
    width: 16px;
    text-align: center;
}

.sun-data-item .item-label {
    color: var(--text-muted);
    flex: none;
}

.direction-hint {
    color: var(--accent-neon);
    font-weight: 500;
    font-size: 0.8rem;
    margin-top: 0.15rem;
}

.sunset-warning {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.3);
    color: #ff9e9e;
    padding: 1rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.4;
    margin-top: 0.5rem;
}

.sunset-warning i {
    color: var(--danger);
    margin-top: 2px;
}

.intro-message {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    width: calc(100% - 4rem);
    max-width: 450px;
}

.intro-content {
    padding: 2rem;
    text-align: center;
}

.intro-content h2 {
    color: var(--accent-neon);
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.intro-content p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.intro-content p:last-child {
    margin-bottom: 0;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* --- Panel Footer / Compare Add Button --- */
.panel-footer {
    margin-top: 1rem;
    text-align: center;
}

.compare-add-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 0.85rem;
    padding: 0.6rem 1.25rem;
    border-radius: 100px;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.compare-add-btn:hover {
    background: rgba(255, 204, 0, 0.1);
    color: var(--accent-neon);
    border-color: rgba(255, 204, 0, 0.3);
}

/* --- Comparison Panel --- */
.compare-panel {
    position: absolute;
    top: 5.5rem;
    right: clamp(1rem, 3vw, 2rem);
    width: 320px;
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
    padding: 1.25rem;
    border-radius: 1.25rem;
    pointer-events: auto;
    animation: fadeInDown 0.4s ease-out;
    z-index: 11;
}

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

.compare-header h3 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.compare-header h3 i {
    color: var(--accent-neon);
}

.compare-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.compare-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1rem;
    padding: 1rem;
    position: relative;
    animation: fadeInDown 0.3s ease-out;
}

.compare-card-remove {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 2px 6px;
    border-radius: 50%;
    transition: var(--transition);
}

.compare-card-remove:hover {
    color: var(--danger);
    background: rgba(255, 71, 87, 0.15);
}

.compare-card-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    padding-right: 1.5rem;
}

.compare-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    font-size: 0.78rem;
}

.compare-card-grid .cc-label {
    color: var(--text-muted);
}

.compare-card-grid .cc-value {
    text-align: right;
    font-weight: 600;
}

.compare-card-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 100px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.badge-total {
    background: rgba(255, 204, 0, 0.15);
    color: var(--accent-neon);
    border: 1px solid rgba(255, 204, 0, 0.3);
}

.badge-partial {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- Heatmap Legend --- */
.heatmap-legend {
    position: absolute;
    bottom: 2rem;
    right: clamp(1rem, 3vw, 2rem);
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    pointer-events: auto;
    z-index: 11;
    animation: fadeInDown 0.4s ease-out;
}

.heatmap-legend h4 {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.heatmap-scale {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.heatmap-scale-bar {
    height: 10px;
    flex: 1;
    border-radius: 5px;
    background: linear-gradient(to right, #3b82f6, #22c55e, #eab308, #f97316, #ef4444);
}

.cloud-scale-bar {
    height: 10px;
    flex: 1;
    border-radius: 5px;
    background: linear-gradient(to right, #4cd964, #ffcc00, #ff9900, #8e8e93);
}

.heatmap-scale-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.cloud-year-slider-container {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 10px;
}

.cloud-year-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-neon);
    text-align: center;
}

.cloud-year-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.15);
    outline: none;
    cursor: pointer;
}

.cloud-year-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-neon);
    cursor: pointer;
    box-shadow: 0 0 6px rgba(255, 204, 0, 0.5);
}

.cloud-year-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-neon);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 6px rgba(255, 204, 0, 0.5);
}

/* Responsiveness */
@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
    }

    .logo {
        justify-content: center;
        margin-bottom: 0.5rem;
    }

    .header-controls {
        display: none;
        /* hidden by default on mobile */
        flex-direction: column;
        position: absolute;
        top: 100%;
        right: 1rem;
        background: rgba(18, 20, 28, 0.95);
        backdrop-filter: blur(10px);
        padding: 1rem;
        border-radius: 1rem;
        border: 1px solid rgba(255, 255, 255, 0.1);
        margin-top: 0.5rem;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        z-index: 1000;
    }

    .header-controls.show {
        display: flex;
    }

    .mobile-menu-btn {
        display: grid;
        position: absolute;
        top: 1rem;
        right: 1rem;
    }

    #comparator-panel,
    #btn-comparator {
        display: none !important;
    }

    .info-panel,
    .intro-message {
        bottom: 1rem;
        left: 1rem;
        width: calc(100% - 2rem);
        padding: 1.5rem;
    }

    .eclipse-timeline {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem 0.5rem;
        padding: 1.25rem 0.5rem;
    }

    .timeline-step {
        flex: 1 1 28%;
        min-width: 80px;
        max-width: 110px;
    }

    .eclipse-visual-row {
        flex-direction: column;
        gap: 1rem;
    }

    .countdown-badge {
        top: auto;
        bottom: auto;
        position: relative;
        margin: 0.5rem auto 0;
        font-size: 0.8rem;
        align-self: center;
    }

    .score-tooltip {
        width: 280px;
    }
}

/* --- Simulation Modals --- */
.simulation-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    padding: 1.5rem;
    z-index: 1000;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

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

.modal-header h3 {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--accent-neon);
}

.beads-modal-wide {
    max-width: 580px;
}

.beads-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 1rem;
    padding: 1rem;
    border: 1px solid var(--glass-border);
}

#beads-canvas {
    width: 100%;
    height: auto;
    max-width: 450px;
    background: #000;
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(255, 204, 0, 0.15), inset 0 0 60px rgba(0,0,0,0.5);
}

.beads-phase-indicator {
    font-family: monospace;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-neon);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0.3rem 0.8rem;
    background: rgba(255, 204, 0, 0.08);
    border: 1px solid rgba(255, 204, 0, 0.15);
    border-radius: 100px;
}

.beads-controls {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.beads-play-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: var(--accent-neon);
    cursor: pointer;
    transition: var(--transition);
    display: grid;
    place-items: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.beads-play-btn:hover {
    background: rgba(255, 204, 0, 0.15);
    border-color: rgba(255, 204, 0, 0.4);
    transform: scale(1.1);
}

#beads-scrub {
    flex: 1;
}

.beads-time {
    font-family: monospace;
    color: var(--accent-neon);
    font-size: 0.9rem;
    min-width: 50px;
    text-align: right;
}

#horizon-3d-container {
    width: 100%;
    height: 300px;
    background: #000;
    border-radius: 1rem;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--glass-border);
}

#horizon-3d-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: rgba(0, 0, 0, 0.75);
    color: var(--accent-neon);
    font-size: 0.95rem;
    font-weight: 500;
    z-index: 10;
    letter-spacing: 0.3px;
}

.simulation-desc {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    text-align: center;
}

/* --- Beads Help Button & Modal --- */
.modal-header-actions {
    display: flex;
    align-items: center;
    margin-right: 25px;
}

.beads-help-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    display: grid;
    place-items: center;
    font-size: 0.9rem;
}

.beads-help-btn:hover {
    background: rgba(255, 204, 0, 0.12);
    border-color: rgba(255, 204, 0, 0.35);
    color: var(--accent-neon);
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(255, 204, 0, 0.15);
}

.beads-help-modal {
    z-index: 1001;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.beads-help-content {
    overflow-y: auto;
    padding: 0.25rem 0.25rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.beads-help-content::-webkit-scrollbar {
    width: 4px;
}

.beads-help-content::-webkit-scrollbar-track {
    background: transparent;
}

.beads-help-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.help-section {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.help-section:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.25);
}

.help-section-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 204, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent-neon);
    font-size: 1rem;
}

.help-section-icon.diamond-icon {
    background: rgba(180, 200, 255, 0.1);
    color: #b4c8ff;
}

.help-section-icon.warning-icon {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
    font-size: 1.1rem;
}

.help-section-body h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--text-main);
}

.help-section-body p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin: 0;
}

.help-section-body p strong {
    color: var(--text-main);
}

.help-section-warning {
    border-color: rgba(231, 76, 60, 0.2);
    background: rgba(231, 76, 60, 0.06);
}

.help-section-warning:hover {
    border-color: rgba(231, 76, 60, 0.35);
    background: rgba(231, 76, 60, 0.1);
}

.help-section-warning h4 {
    color: #ff6b6b;
}

.help-safety-rule {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 0.5rem;
    border: 1px solid rgba(231, 76, 60, 0.15);
    font-size: 0.8rem;
    color: #dcdde1;
    line-height: 1.5;
}

.help-safety-rule i {
    color: #e67e22;
    font-size: 1rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.help-safety-rule strong {
    color: #f1f2f6;
}

.help-safety-timeline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.85rem;
    padding: 0.75rem 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.safety-phase {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
    font-size: 0.65rem;
    color: #a4b0be;
    text-transform: uppercase;
    min-width: 65px;
}

.safety-phase i {
    font-size: 1.1rem;
}

.safety-phase.danger i {
    color: #e74c3c;
}

.safety-phase.danger strong {
    color: #e74c3c;
}

.safety-phase.safe i {
    color: #2ecc71;
}

.safety-phase.safe strong {
    color: #2ecc71;
}

.safety-arrow {
    color: rgba(255, 255, 255, 0.15);
    font-size: 0.7rem;
}


/* New buttons in info-panel footer */
.panel-footer {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.simulation-btn {
    flex: 1;
    min-width: 120px;
    padding: 0.75rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 204, 0, 0.2);
    background: rgba(255, 204, 0, 0.05);
    color: var(--accent-neon);
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.simulation-btn:hover {
    background: rgba(255, 204, 0, 0.15);
    border-color: var(--accent-neon);
    transform: translateY(-2px);
}

@media (max-width: 600px) {
    .simulation-modal {
        width: 95%;
        padding: 1rem;
    }
}

/* --- Version Badge --- */
.version-badge {
    position: absolute;
    bottom: 1rem;
    right: 3rem;
    padding: 0.4rem 0.8rem;
    border-radius: 100px;
    background: rgba(18, 20, 28, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    pointer-events: auto;
    transition: var(--transition);
    z-index: 15;
    letter-spacing: 0.3px;
}

.version-badge:hover {
    background: rgba(255, 204, 0, 0.1);
    border-color: rgba(255, 204, 0, 0.3);
    color: var(--accent-neon);
}

.version-badge i {
    font-size: 0.65rem;
    opacity: 0.6;
}

/* --- Changelog Modal --- */
.changelog-content {
    max-height: 60vh;
    overflow-y: auto;
    padding: 0.5rem;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.changelog-content::-webkit-scrollbar {
    width: 4px;
}

.changelog-content::-webkit-scrollbar-track {
    background: transparent;
}

.changelog-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.changelog-version {
    margin-bottom: 1.5rem;
}

.changelog-version-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.changelog-version-tag {
    background: rgba(255, 204, 0, 0.12);
    color: var(--accent-neon);
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.changelog-version-date {
    color: var(--text-muted);
    font-size: 0.75rem;
    opacity: 0.7;
}

.changelog-section {
    margin-bottom: 0.75rem;
}

.changelog-section-title {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.8rem;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.changelog-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.changelog-section li {
    padding: 0.2rem 0 0.2rem 1.2rem;
    position: relative;
    font-size: 0.8rem;
}

.changelog-section li::before {
    content: '›';
    position: absolute;
    left: 0.3rem;
    color: var(--accent-neon);
    opacity: 0.6;
    font-weight: 700;
}