* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0f;
    color: #fff;
    overflow: hidden;
}
#map { width: 100vw; height: 100vh; }
#info-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    max-width: 360px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1;
    display: none;
}
#info-panel.visible {
    display: block;
}
#info-panel h2 {
    font-size: 14px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}
.coords {
    font-size: 13px;
    color: #aaa;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.eclipse-card {
    margin-bottom: 16px;
}
.eclipse-card h3 {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.eclipse-card .date {
    font-size: 24px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}
.eclipse-card .time {
    font-size: 14px;
    color: #aaa;
}
.eclipse-card .duration {
    font-size: 14px;
    color: #f5a623;
    margin-top: 4px;
}
.eclipse-card.previous .date { color: #7eb8da; }
.eclipse-card.next .date { color: #f5a623; }
.no-eclipse {
    color: #666;
    font-style: italic;
}
.nasa-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 12px;
    color: #7eb8da;
    text-decoration: none;
}
.nasa-link:hover {
    text-decoration: underline;
}
#search-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
#main-title {
    font-size: 28px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 4px 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
#search-box {
    display: flex;
    gap: 8px;
}
#search-input {
    width: 280px;
    padding: 12px 16px;
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    backdrop-filter: blur(10px);
}
#search-input::placeholder { color: #666; }
#search-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
}
#search-wrapper {
    position: relative;
}
#autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: rgba(20, 20, 30, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    max-height: 240px;
    overflow-y: auto;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    display: none;
    z-index: 10;
}
#autocomplete-list.visible {
    display: block;
}
.autocomplete-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.15s;
}
.autocomplete-item:last-child {
    border-bottom: none;
}
.autocomplete-item:hover,
.autocomplete-item.active {
    background: rgba(255, 255, 255, 0.1);
}
.autocomplete-item-name {
    font-size: 14px;
    color: #fff;
    margin-bottom: 2px;
}
.autocomplete-item-context {
    font-size: 12px;
    color: #888;
}
#search-btn {
    padding: 12px 16px;
    background: rgba(245, 166, 35, 0.9);
    border: none;
    border-radius: 8px;
    color: #000;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
#search-btn:hover { background: rgba(245, 166, 35, 1); }
#landmarks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 360px;
}
.landmark-btn {
    padding: 8px 12px;
    background: rgba(20, 20, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #ccc;
    font-size: 12px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.2s;
}
.landmark-btn:hover {
    background: rgba(40, 40, 55, 0.95);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
}
#legend {
    position: fixed;
    bottom: 60px;
    left: 20px;
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 16px;
    backdrop-filter: blur(10px);
    font-size: 13px;
    z-index: 1;
}
#legend h4 {
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.legend-item:last-child {
    margin-bottom: 0;
}
.legend-line {
    width: 24px;
    height: 3px;
    border-radius: 2px;
}
.legend-line.previous { background: #7eb8da; }
.legend-line.next { background: #f5a623; }

.mapboxgl-popup-content {
    background: rgba(20, 20, 30, 0.95);
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 13px;
    backdrop-filter: blur(10px);
}
.mapboxgl-popup-tip {
    border-top-color: rgba(20, 20, 30, 0.95) !important;
}
.mapboxgl-popup-close-button {
    color: #888;
    font-size: 18px;
    padding: 4px 8px;
}
.mapboxgl-popup-close-button:hover {
    color: #fff;
    background: transparent;
}
.path-popup-time {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}
.path-popup-coords {
    color: #888;
    font-size: 12px;
}
#instructions {
    position: fixed;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 30, 0.95);
    padding: 16px 32px;
    border-radius: 12px;
    font-size: 16px;
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.15);
    text-align: center;
    z-index: 1;
}
#attribution {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #666;
    text-align: center;
    z-index: 1;
}
#attribution a {
    color: #7eb8da;
    text-decoration: none;
}
#attribution a:hover {
    text-decoration: underline;
}
.loading {
    color: #666;
    font-style: italic;
}
.mapboxgl-ctrl-bottom-left,
.mapboxgl-ctrl-bottom-right {
    display: none;
}
#loading-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 20px 32px;
    display: none;
    align-items: center;
    gap: 12px;
    z-index: 100;
    backdrop-filter: blur(10px);
}
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: #f5a623;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Tab Navigation */
#tab-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 12px;
}
.tab-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #888;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}
.tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ccc;
}
.tab-btn.active {
    background: rgba(245, 166, 35, 0.15);
    border-color: rgba(245, 166, 35, 0.5);
    color: #f5a623;
}
.tab-panel {
    display: none;
}
.tab-panel.active {
    display: block;
}

/* Eclipse List */
.eclipse-list-header {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}
.eclipse-list-items {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.eclipse-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.eclipse-list-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}
.eclipse-list-item.selected {
    background: rgba(245, 166, 35, 0.15);
    border-color: rgba(245, 166, 35, 0.4);
}
.eclipse-list-item-date {
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    flex: 1;
}
.eclipse-list-item.past .eclipse-list-item-date {
    color: #7eb8da;
}
.eclipse-list-item.future .eclipse-list-item-date {
    color: #f5a623;
}
.eclipse-list-item-duration {
    font-size: 12px;
    color: #888;
}
.eclipse-list-item-badge {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.eclipse-list-item.past .eclipse-list-item-badge {
    background: rgba(126, 184, 218, 0.2);
    color: #7eb8da;
}
.eclipse-list-item.future .eclipse-list-item-badge {
    background: rgba(245, 166, 35, 0.2);
    color: #f5a623;
}
#eclipse-list-loading {
    text-align: center;
    padding: 20px;
}

/* Gap Chart */
#gap-chart {
    width: 100%;
    min-height: 200px;
}
#chart-loading {
    text-align: center;
    padding: 20px;
}
.gap-chart-svg {
    width: 100%;
    height: 200px;
}
.gap-bar {
    cursor: pointer;
    transition: opacity 0.2s;
}
.gap-bar:hover {
    opacity: 0.8;
}
.gap-label {
    font-size: 10px;
    fill: #888;
}
.eclipse-marker {
    cursor: pointer;
}
.now-line {
    stroke: #fff;
    stroke-width: 1;
    stroke-dasharray: 4,4;
}
.chart-axis {
    stroke: rgba(255,255,255,0.2);
    stroke-width: 1;
}
.chart-header {
    font-size: 12px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}
.chart-subheader {
    display: block;
    font-size: 10px;
    text-transform: none;
    color: #666;
    margin-top: 4px;
    letter-spacing: 0;
}
.gap-tooltip {
    position: absolute;
    background: rgba(20, 20, 30, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    color: #fff;
    pointer-events: none;
    z-index: 10;
    white-space: nowrap;
    backdrop-filter: blur(10px);
}
.gap-tooltip-years {
    font-weight: 600;
    margin-bottom: 4px;
}
.gap-tooltip-dates {
    color: #888;
    font-size: 11px;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    #search-container {
        top: 8px;
        left: 8px;
        right: 8px;
        width: auto;
        gap: 8px;
    }
    
    #main-title {
        font-size: 18px;
        margin-bottom: 0;
    }
    
    #search-box {
        width: 100%;
        gap: 6px;
    }
    
    #search-input {
        width: 100%;
        flex: 1;
        padding: 8px 12px;
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 6px;
    }
    
    #search-btn {
        padding: 8px 12px;
        flex-shrink: 0;
        font-size: 13px;
        border-radius: 6px;
    }
    
    #landmarks {
        max-width: 100%;
        gap: 4px;
    }
    
    .landmark-btn {
        padding: 4px 8px;
        font-size: 10px;
        border-radius: 4px;
    }
    
    #info-panel {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100%;
        border-radius: 12px 12px 0 0;
        padding: 12px;
        max-height: 35vh;
        overflow-y: auto;
        transform: translateY(0);
        transition: transform 0.3s ease;
    }

    #tab-nav {
        margin-bottom: 10px;
        padding-bottom: 8px;
    }

    .tab-btn {
        padding: 6px 12px;
        font-size: 11px;
    }

    .eclipse-list-items {
        max-height: 150px;
    }

    .eclipse-list-item {
        padding: 8px 10px;
        gap: 8px;
    }

    .eclipse-list-item-date {
        font-size: 13px;
    }

    .eclipse-list-item-duration {
        font-size: 10px;
    }

    .eclipse-list-item-badge {
        font-size: 9px;
        padding: 2px 6px;
    }
    
    #info-panel h2 {
        font-size: 11px;
        margin-bottom: 8px;
    }
    
    .eclipse-card .date {
        font-size: 16px;
    }
    
    .eclipse-card .time {
        font-size: 12px;
    }
    
    .eclipse-card .duration {
        font-size: 12px;
    }
    
    .eclipse-card h3 {
        font-size: 10px;
        margin-bottom: 4px;
    }
    
    .eclipse-card {
        margin-bottom: 10px;
    }
    
    .nasa-link {
        font-size: 11px;
        margin-top: 4px;
    }
    
    #legend {
        bottom: auto;
        top: 8px;
        right: 8px;
        left: auto;
        padding: 6px 10px;
        font-size: 10px;
        border-radius: 6px;
    }
    
    #legend h4 {
        font-size: 9px;
        margin-bottom: 4px;
    }
    
    .legend-item {
        gap: 6px;
        margin-bottom: 2px;
    }
    
    .legend-line {
        width: 14px;
        height: 2px;
    }
    
    #instructions {
        bottom: auto;
        top: 50%;
        left: 8px;
        right: 8px;
        transform: translateY(-50%);
        padding: 10px 16px;
        font-size: 12px;
        border-radius: 8px;
    }
    
    #attribution {
        bottom: 4px;
        left: 8px;
        right: 8px;
        width: auto;
        transform: none;
        font-size: 9px;
        line-height: 1.3;
    }
    
    .mapboxgl-popup-content {
        padding: 8px 12px;
        font-size: 11px;
    }
    
    .path-popup-time {
        font-size: 13px;
    }
    
    #loading-overlay {
        left: 8px;
        right: 8px;
        width: auto;
        transform: translate(0, -50%);
        padding: 12px 20px;
        font-size: 13px;
    }

    /* Gap Chart Mobile */
    #gap-chart {
        min-height: 150px;
    }
    .gap-chart-svg {
        height: 150px;
    }
    .gap-label {
        font-size: 8px;
    }
    .chart-header {
        font-size: 10px;
        margin-bottom: 8px;
    }
}

/* Extra small screens */
@media (max-width: 380px) {
    #main-title {
        font-size: 16px;
    }
    
    #landmarks {
        gap: 3px;
    }
    
    .landmark-btn {
        padding: 3px 6px;
        font-size: 9px;
    }
    
    #info-panel {
        padding: 10px;
        max-height: 30vh;
    }
    
    .eclipse-card .date {
        font-size: 14px;
    }
    
    .eclipse-card .time,
    .eclipse-card .duration {
        font-size: 11px;
    }
    
    #instructions {
        font-size: 11px;
        padding: 8px 12px;
    }
}


