@import "../style.css";

/* ======================================================
   GEOGRAPHY DETAIL PAGES
   ====================================================== */

/* Page-specific overrides */
body {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

body::before {
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%),
                linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 3px, 3px 100%;
}

/* --- HEADER --- */
header {
    display: flex;
    align-items: center;
    padding: 10px 40px;
    border-bottom: 1px solid var(--crt-color);
    justify-content: space-between;
    margin-top: 40px;
}

.header-left { width: 150px; }
.au-text { font-size: 1.5rem; opacity: 0.8; }
.home-icon { cursor: pointer; font-size: 2rem; text-decoration: none; color: inherit; display: block; margin-top: 5px; }

.planet-name {
    font-family: var(--font-main);
    font-size: 4rem;
    letter-spacing: 10px;
    text-transform: uppercase;
    flex-grow: 1;
    margin-left: 20px;
    text-align: left;
}

.header-right {
    display: flex;
    gap: 20px;
    font-size: 1.5rem;
}

.header-right a {
    color: var(--crt-color);
    text-decoration: none;
    border: 1px solid var(--crt-color);
    padding: 5px 15px;
    transition: all 0.2s ease;
}

.header-right a:hover {
    background: rgba(167, 199, 231, 0.2);
}

/* --- CONTENT LAYOUT --- */
.content-wrapper {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
}

.sidebar {
    width: 320px;
    padding: 20px;
    border-right: 1px solid rgba(167, 199, 231, 0.2);
    overflow-y: auto;
    scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar img, .dynamic-img {
    width: 100%;
    margin-bottom: 12px;
    border: 1px solid rgba(167, 199, 231, 0.3);
    display: block;
    cursor: pointer; 
    transition: border-color 0.2s;
}
.sidebar img:hover, .dynamic-img:hover { border-color: var(--highlight); }

.main-content {
    flex-grow: 1;
    padding: 20px 40px;
    overflow-y: auto;
    scrollbar-width: none;
}
.main-content::-webkit-scrollbar { display: none; }

/* --- STATS TABLE --- */
.stats-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; font-size: 1.3rem; }
.stats-table td { padding: 8px 12px; border-bottom: 1px solid rgba(167, 199, 231, 0.2); }
.stats-table tr:nth-child(2) { background-color: rgba(139, 110, 30, 0.3); }
.stats-table .label { font-weight: bold; color: var(--crt-color); width: 180px; }
.stats-table .value { color: var(--crt-color); opacity: 0.9; }

/* --- TRAVEL BOX --- */
.travel-box {
    background-color: var(--box-orange);
    border: 1px solid rgba(200, 120, 30, 0.6);
    padding: 14px 18px;
    margin-bottom: 20px;
    font-size: 1.2rem;
    line-height: 1.5;
    color: #f0d9b5;
}

/* --- DESCRIPTION --- */
.description { font-size: 1.2rem; line-height: 1.6; color: rgba(167, 199, 231, 0.85); white-space: pre-line; }
.description .lore-subtitle {
    display: block;
    font-family: var(--font-main);
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--crt-color);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin: 20px 0 8px 0;
    text-shadow: 0 0 6px var(--crt-blue-dim);
}

/* --- FOOTER --- */
footer {
    border-top: 1px solid rgba(167, 199, 231, 0.2);
    padding: 6px 40px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    font-size: 1rem;
    opacity: 0.6;
}

/* --- MAP BUTTON --- */
#map-btn {
    display: none; margin-top: 10px; background: transparent; border: 1px solid var(--crt-color); color: var(--crt-color); font-family: var(--font-term); font-size: 1.2rem; padding: 4px 14px; cursor: pointer; width: 100%; margin-bottom: 12px;
}
#map-btn:hover { background: rgba(167, 199, 231, 0.15); }

/* --- IMAGE MODAL (LIGHTBOX) --- */
.modal {
    display: none; 
    position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.9);
    align-items: center; justify-content: center;
}
.modal-content {
    max-width: 90%; max-height: 90%;
    border: 2px solid var(--crt-color);
    box-shadow: 0 0 20px rgba(167, 199, 231, 0.3);
    object-fit: contain;
}
.close-btn {
    position: absolute; top: 20px; right: 35px;
    color: var(--crt-color); font-size: 40px; font-weight: bold; cursor: pointer;
    font-family: sans-serif;
    transition: 0.3s;
}
.close-btn:hover { color: var(--highlight); }

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    header { flex-direction: column; align-items: flex-start; gap: 10px; padding: 15px; margin-top: 36px; }
    .header-right { width: 100%; justify-content: space-between; font-size: 1.2rem; }
    .planet-name { font-size: 3rem; margin-left: 0; margin-top: 10px; }
    
    .content-wrapper { flex-direction: column; overflow-y: auto; }
    
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid rgba(167, 199, 231, 0.2); padding: 15px; }
    .main-content { padding: 15px; overflow-y: visible; }
    
    /* Converts 4-column Table into a 2-column stacked layout */
    .stats-table tr {
        display: flex;
        flex-wrap: wrap;
    }
    .stats-table td {
        width: 50%;
        padding: 8px 5px;
        border-bottom: 1px solid rgba(167, 199, 231, 0.1);
    }
    .stats-table .label {
        width: 45%; 
    }
    .stats-table .value {
        width: 55%; 
        word-break: break-word;
    }
}
