/* * Halo Theme ("style.css")
 * This is the main, active stylesheet.
 */
@import url('https://fonts.googleapis.com/css2?family=Titillium+Web:wght@400;700&display=swap');

body {
    background-color: #030814;
    background-image: radial-gradient(ellipse at center, #0c1a3a 0%, #030814 70%, #000000 100%);
    background-attachment: fixed;
    color: #e0e0e0;
    font-family: 'Titillium Web', 'Helvetica', 'Arial', sans-serif;
    font-size: 1.1em;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    /* Remove global browser scrollbar */
    overflow: hidden; 
}

/* --- App Header (Outside Site Wrapper) --- */
.app-header {
    width: 95vw; /* Match site-wrapper max-width */
    max-width: 1200px; 
    margin: 5vh auto 0; 
    padding-left: 260px; /* Offset for sidebar */
    box-sizing: border-box;
}

.header-content {
    width: 90%;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: baseline;
    gap: 20px;
}

.app-header h1 {
    font-family: 'Titillium Web', sans-serif;
    color: #ffffff;
    font-size: 2em;
    margin: 0;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(136, 170, 255, 0.5);
    line-height: 1;
}

.app-header p {
    font-size: 1.1em;
    color: #88aaff;
    margin: 0;
    font-style: italic;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

/* --- Main Layout --- */
.site-wrapper {
    display: flex;
    flex-direction: row;
    height: calc(100vh - 100px); /* Adjust height to account for header */
    margin-top: 10px; /* Small gap between header and window */
}

/* --- Sidebar --- */
.sidebar {
    flex-basis: 260px;
    flex-shrink: 0;
    background-color: rgba(3, 5, 15, 0.7);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-right: 1px solid #1a2a4a;
    padding: 10px 20px 20px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow-y: auto;
}

.sidebar-header {
    text-align: center;
    /* border-bottom: 1px solid #1a2a4a; */
    padding-bottom: 5px;
    margin-bottom: 5px;
    min-height: 0; /* Ensure some height even if empty */
}
/* Removed h1 and p styles from sidebar-header as they are moved */

.sidebar .navigation {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar .navigation li {
    margin-bottom: 5px;
}
.sidebar .navigation a {
    color: #ffffff;
    text-decoration: none;
    font-size: 1.1em;
    display: block;
    padding: 8px 10px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.sidebar .navigation a:hover {
    background-color: rgba(26, 42, 74, 0.5);
    color: #ffffff;
}
.sidebar .navigation a.active {
    background-color: #1a2a4a;
    color: #ffffff;
    cursor: default;
}
.sidebar .navigation a.active:hover {
    background-color: #1a2a4a;
}
.sidebar .nav-separator {
    height: 1px;
    background-color: #1a2a4a;
    margin: 15px 0;
}
.sidebar .nav-heading {
    font-family: 'Titillium Web', sans-serif;
    color: #88aaff;
    font-size: 0.9em;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 10px;
}
.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #1a2a4a;
    font-size: 0.8em;
    color: #777;
    text-align: center;
}

/* --- Main Column (Right Side) --- */
.main-column {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Manage internal scrolling */
}

/* Removed .main-header styles */

/* --- Content Panel --- */
.content {
    flex-grow: 1;
    padding: 20px 40px 40px;
    width: 90%;
    max-width: 900px;
    background-color: rgba(0, 0, 0, 0.4);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    border: 1px solid #1a2a4a;
    border-radius: 8px;
    margin: 20px auto;
    overflow-y: auto;
    box-sizing: border-box;
}
.content > * {
    transition: opacity 0.3s ease-in-out;
}

/* --- Content Elements --- */
.content h2 {
    font-family: 'Titillium Web', sans-serif;
    color: #ffffff;
    font-size: 1.8em;
    font-weight: 700;
    margin-top: 0;
    border-bottom: 1px solid #1a2a4a;
    padding-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.content p {
    margin-bottom: 20px;
}
.content a {
    color: #66b3ff;
    text-decoration: none;
    font-weight: 700;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}
.content a:hover {
    text-decoration: none;
    border-bottom: 1px solid #66b3ff;
}

/* --- Main Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #0c1a3a;
    border: 1px solid #1a2a4a;
    border-radius: 8px;
    width: 90%;
    max-width: 900px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    z-index: 1001;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #1a2a4a;
}
.modal-header h2 {
    color: #fff;
    font-family: 'Titillium Web', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.3em;
    margin: 0;
    border-bottom: none;
    padding-bottom: 0;
}
.modal-close {
    color: #88aaff;
    font-size: 2em;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}
.modal-close:hover {
    color: #fff;
}
.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}
.modal-body img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 15px;
}
#modal-body-content {
    color: #e0e0e0;
    font-size: 1.1em;
    line-height: 1.6;
}

/* --- Character Tooltip --- */
.char-tooltip {
    position: fixed;
    width: 300px;
    background: #0c1a3a;
    border: 1px solid #1a2a4a;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    display: flex;
    padding: 10px;
    gap: 10px;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.char-tooltip.visible {
    opacity: 1;
    visibility: visible;
}
.char-tooltip img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #1a2a4a;
    flex-shrink: 0;
}
.char-tooltip .tooltip-info {
    flex-grow: 1;
}
.char-tooltip h3 {
    font-family: 'Titillium Web', sans-serif;
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0 0 5px 0;
    font-size: 1.1em;
}
.char-tooltip p {
    font-size: 0.9em;
    color: #e0e0e0;
    margin: 0 0 3px 0;
}
.char-tooltip p strong {
    color: #88aaff;
    width: 80px;
    display: inline-block;
}

/* --- Location Tooltip --- */
.location-tooltip {
    position: fixed;
    width: 300px;
    background: #0c1a3a;
    border: 1px solid #1a2a4a;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    padding: 10px;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.location-tooltip.visible {
    opacity: 1;
    visibility: visible;
}
.location-tooltip .tooltip-info {
    flex-grow: 1;
}
.location-tooltip h3 {
    font-family: 'Titillium Web', sans-serif;
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0 0 5px 0;
    font-size: 1.1em;
}
.location-tooltip p {
    font-size: 0.9em;
    color: #e0e0e0;
    margin: 0 0 3px 0;
}
.location-tooltip p strong {
    color: #88aaff;
    width: 80px;
    display: inline-block;
}

.location-tooltip #tooltip-location-desc {
    margin-top: 8px;
    font-style: italic;
    border-top: 1px solid #1a2a4a;
    padding-top: 8px;
}

.char-link {
    font-weight: 700;
    color: #66b3ff;
    text-decoration: none;
    cursor: help;
}

.location-link {
    font-weight: 700;
    color: #66b3ff; 
    text-decoration: none;
    cursor: help;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid #1a2a4a;
    border-radius: 4px;
    cursor: pointer;
    padding: 5px;
    flex-direction: column;
    justify-content: space-around;
    width: 36px;
    height: 36px;
    position: absolute;
    right: 0;
    top: 5px;
}
.mobile-menu-toggle .bar {
    width: 100%;
    height: 3px;
    background-color: #88aaff;
    border-radius: 2px;
}

/* --- Desktop Floating Layout --- */
@media (min-width: 1200px) {
    .site-wrapper {
        height: 88vh; /* Increased height to be closer to the bottom */
        aspect-ratio: 16 / 10;
        max-width: 95vw;
        margin: 10px auto; /* Reduced margin to allow more room */
        border: 1px solid #1a2a4a;
        border-radius: 12px;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
        overflow: hidden;
        background-color: rgba(3, 5, 15, 0.5);
        backdrop-filter: blur(10px);
    }

    .app-header {
        max-width: 95vw;
        margin: 5vh auto 0;
        padding-left: 260px; 
    }

    .sidebar {
        height: 100%;
        border-right: 1px solid #1a2a4a;
        border-radius: 0;
        flex-basis: 260px;
    }

    .content {
        width: auto;
        max-width: none;
        height: auto;
        flex-grow: 1;
        margin: 0;
        border: none;
        border-radius: 0;
        background-color: rgba(0, 0, 0, 0.3);
    }
}

/* --- Mobile Layout --- */
@media (max-width: 900px) {
    .app-header {
        width: 100%;
        padding: 20px;
        text-align: center;
        margin-top: 0;
        padding-left: 0; /* Remove desktop offset */
        position: relative; /* Context for toggle */
    }

    .header-content {
        flex-direction: column;
        align-items: center;
        gap: 5px;
        width: 100%;
    }
    
    .site-wrapper {
        height: auto;
        margin-top: 0;
        border-radius: 0;
        border: none;
        flex-direction: column;
        max-width: 100%;
        overflow: visible;
    }

    html, body {
        overflow-y: auto !important; /* Force scroll */
        height: auto;
    }
    
    /* Sidebar Mobile Logic */
    .sidebar {
        flex-basis: auto;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #1a2a4a;
        padding: 0; /* Remove padding when closed to be slim */
        overflow: visible;
    }

    /* Move toggle to top right of header */
    .mobile-menu-toggle {
        display: flex;
        position: absolute;
        top: 20px;
        right: 20px;
        border-color: #88aaff;
    }

    .sidebar .navigation,
    .sidebar .sidebar-footer {
        display: none; /* Hide by default */
        padding: 20px; /* Add padding back to content */
    }

    .sidebar.nav-open .navigation,
    .sidebar.nav-open .sidebar-footer {
        display: block; /* Show when open */
    }
    
    /* Content Mobile Logic */
    .main-column {
        overflow: visible;
    }

    .content {
        width: 95%;
        margin: 10px auto;
        padding: 15px;
        max-height: none; /* Allow full height expansion */
        overflow: visible;
    }

    /* Modal Mobile Logic */
    .modal-content {
        width: 95%;
        max-height: 85vh; /* Use more screen height */
        display: flex;
        flex-direction: column;
    }
    
    .modal-body {
        max-height: none; /* Let flexbox handle scrolling */
        overflow-y: auto;
        flex-grow: 1;
    }
    
    /* Character Profile Grid Mobile */
    .char-profile-grid {
        grid-template-columns: 1fr !important; /* Force stack */
    }
    
    .char-profile-img {
        max-width: 200px;
        margin: 0 auto 20px;
        display: block;
    }
}