/* style.css */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Rajdhani', sans-serif;
    /* BELANGRIJK: Geen zwarte achtergrond kleur meer! 
       Hierdoor kan de foto niet meer 'per ongeluk' bedekt worden door zwart. */
    background-color: transparent; 
    color: #fff;
    overflow: hidden;
}

/* LAAG 1: De Foto (Helemaal onderop, maar niet 'negatief') */
#cinematic-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; /* Was -1, nu 0 voor zekerheid */
    background-size: cover;
    background-position: center;
    background-color: #050505; /* Fallback donkergrijs als foto laadt */
}

/* LAAG 2: De Kaart (Ligt op de foto) */
#map {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    background: transparent !important;
    z-index: 1; /* Ligt bovenop laag 0 */
}

/* Zorg dat Leaflet containers ook echt doorzichtig zijn */
.leaflet-container {
    background: transparent !important;
}

/* FIX VOOR DE KNOPPEN: Duw ze omlaag onder de header */
.leaflet-top {
    top: 80px; /* Header is +/- 70px, dus dit zet ze er netjes onder */
}
.leaflet-left {
    left: 20px;
}

/* LAAG 3: De UI (Ligt bovenop alles) */
.ui-container {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1000; /* Bovenop kaart */
    pointer-events: none; 
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Header Styling */
.glass-panel {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0 30px;
    height: 80px; /* Iets hoger voor ademruimte */
    display: flex;
    align-items: center; /* Verticaal centreren */
    pointer-events: auto;
}

.top-bar {
    justify-content: space-between;
}

.logo-group {
    display: flex;
    align-items: center;
    height: 100%;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #00eeff;
    text-shadow: 0 0 15px rgba(0, 238, 255, 0.5);
}

/* Status Panel Fix */
.status-panel {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 15px;
    color: #ccc;
    border-left: 1px solid #333;
    padding-left: 20px;
}

/* Footer Styling */
.bottom-bar {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    height: auto;
    padding: 20px 30px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.0));
}

/* Space Station Icons - with glow for visibility */
.iss-icon {
    filter: invert(1) drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
}

.tiangong-icon {
    filter: invert(1) drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
}

/* Spacecraft Icons - subtle or no glow */
.progress-icon {
    filter: invert(1) drop-shadow(0 0 2px rgba(255, 255, 255, 0.3));
}

.soyuz-icon {
    filter: invert(1) drop-shadow(0 0 2px rgba(255, 255, 255, 0.3));
}

.generic-satellite-icon {
    filter: invert(1);
}

.map-toggle-btn {
    background: rgba(0, 238, 255, 0.2);
    border: 2px solid rgba(0, 238, 255, 0.5);
    border-radius: 8px;
    padding: 8px 14px;
    color: #00eeff;
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    pointer-events: auto;
}

.map-toggle-btn:hover {
    background: rgba(0, 238, 255, 0.3);
    border-color: #00eeff;
    box-shadow: 0 0 20px rgba(0, 238, 255, 0.4);
}

.map-toggle-btn .toggle-icon {
    font-size: 18px;
}

.map-toggle-btn.map-hidden {
    background: rgba(255, 60, 60, 0.2);
    border-color: rgba(255, 60, 60, 0.5);
    color: #ff3c3c;
}

.map-toggle-btn.map-hidden:hover {
    background: rgba(255, 60, 60, 0.3);
    border-color: #ff3c3c;
    box-shadow: 0 0 20px rgba(255, 60, 60, 0.4);
}

/* Orbital track styling */
.orbital-track {
    pointer-events: none;
    z-index: 600 !important;
}

#map.map-hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

/* When map is hidden, make info panel more transparent */
.info-panel.map-hidden {
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(3px);
}

.info-panel.map-hidden.active {
    background: rgba(0, 0, 0, 0.25);
}

#map {
    transition: opacity 0.5s ease;
}
/* Custom scrollbar for clustered popups */
.leaflet-popup-content::-webkit-scrollbar {
    width: 8px;
}

.leaflet-popup-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.leaflet-popup-content::-webkit-scrollbar-thumb {
    background: rgba(0, 238, 255, 0.5);
    border-radius: 4px;
}

.leaflet-popup-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 238, 255, 0.7);
}

/* Info Panel - Fixed sidebar for satellite/launch/APOD info */
.info-panel {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 320px;
    max-height: 90vh;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 238, 255, 0.2);
    border-radius: 8px;
    padding: 20px;
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.info-panel.active {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(0, 238, 255, 0.5);
    box-shadow: 0 0 30px rgba(0, 238, 255, 0.3);
}

.info-panel-content {
    color: #fff;
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.panel-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 238, 255, 0.2);
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.panel-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    flex: 1;
    min-height: 0;
}

.panel-section h3 {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: #00eeff;
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-grid {
    display: grid;
    gap: 10px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.info-item.crew-item {
    flex-direction: row;
    align-items: flex-start;
}

.crew-list {
    margin-top: 0;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 5px;
    flex: 1;
    text-align: right;
}

.crew-list::-webkit-scrollbar {
    width: 4px;
}

.crew-list::-webkit-scrollbar-track {
    background: transparent;
}

.crew-list::-webkit-scrollbar-thumb {
    background: rgba(0, 238, 255, 0.4);
    border-radius: 2px;
}

.crew-member {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
    font-size: 15px;
    color: #fff;
    padding: 4px 0;
    text-align: right;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.info-label {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item span:last-child {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
    font-size: 15px;
    color: #fff;
}

.panel-mission {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
    font-size: 15px;
    color: #fff;
    margin-bottom: 8px;
}

.panel-time {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 300;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.panel-countdown {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: #00eeff;
}

.panel-apod-title {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: #fff;
    margin-bottom: 8px;
}

.panel-apod-description {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 300;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin-bottom: 10px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    padding-right: 5px;
}

.panel-apod-description::-webkit-scrollbar {
    width: 4px;
}

.panel-apod-description::-webkit-scrollbar-track {
    background: transparent;
}

.panel-apod-description::-webkit-scrollbar-thumb {
    background: rgba(0, 238, 255, 0.4);
    border-radius: 2px;
}

.panel-apod-copyright {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 300;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}
