/* --- AESTHETIC & COLOR PALETTE --- */
:root {
    --bg-color: #1e363a; 
    --window-bg: rgba(37, 34, 37, 0.856);
    --border-color: #f5ebf1;
    --smooth-cyan: #83def3;
    --text-color: #fceeff;
    --glow-pink: #f079bc;
    --glow-cyan: #6fe5ff;
    --shadow-color: rgba(2, 213, 250, 0.493);

    --font-pixel: 'VT323', monospace;
    --font-body: 'Source Code Pro', monospace;
}

/* --- BASIC SETUP --- */
body {
    background-color: var(--bg-color);
    background-image: url('resources/aurora-background2.png');
    background-size: cover;
    background-attachment: fixed;
    
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 16px;
    margin: 0;
    padding: 1rem;
}

/* --- NEW: PAGE LAYOUT USING CSS GRID --- */
.page-layout {
    display: grid;
    /* Define columns: left (1fr), main (2.5fr), right (1fr) */
    grid-template-columns: 1fr 2.5fr 1fr;
    /* Define rows: banner auto height, main content auto height */
    grid-template-rows: auto auto;
    /* Define the layout areas */
    grid-template-areas: 
        "banner banner banner"
        "left main right";
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* --- UPDATED: BANNER STYLING & PLACEMENT --- */
/* REPLACE IT WITH THIS UPDATED BLOCK */
.site-banner {
    grid-area: banner;
    display: flex; /* Helps center the h1 perfectly */
    justify-content: center;
    align-items: center;
    min-height: 225px; /* Give the banner some height */
    position: relative; /* Still good to have for positioning context */
    border: 5px solid var(--border-color);
    
    /* --- THESE LINES ARE THE IMPORTANT ADDITION --- */
    background-image: url('resources/banner-website.jpg');
    background-size: cover;
    background-position: center;
}

.site-banner h1 {
    font-family: var(--font-pixel);
    font-size: 5rem;
    margin: 0;
    animation: neon-flicker-sharp 4s infinite linear;
    z-index: 10; /* Ensure the text is on top of the image slices */
    position: relative; /* Needed for z-index to work properly */
}



/* --- UPDATED: SHARPER NEON KEYFRAME ANIMATION --- */
@keyframes neon-flicker-sharp {
    0%, 100% {
        color: #fff;
        text-shadow:
            0 0 2px #fff, /* Sharp white core */
            0 0 5px var(--glow-pink),
            0 0 10px var(--glow-pink),
            0 0 20px #ff00de; /* Outer haze */
    }
    50% {
        color: #fff;
        text-shadow:
            0 0 2px #fff, /* Sharp white core */
            0 0 5px var(--glow-cyan),
            0 0 10px var(--glow-cyan),
            0 0 20px #00c3ff; /* Outer haze */
    }
}


/* --- PLACING COLUMNS IN THE GRID --- */
.left-column { grid-area: left; }
.main-content { grid-area: main; }
.right-column { grid-area: right; }

.left-column, .main-content, .right-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* Space between windows in the same column */
}


/* --- THE WINDOW STYLE (No changes needed here) --- */
.window {
    border: 2px solid var(--border-color);
    background-color: var(--window-bg);
    backdrop-filter: blur(5px);
    box-shadow: 
        inset 0 0 0 1px var(--border-color),
        5px 5px 15px var(--shadow-color);
    font-family: var(--font-pixel);
    font-size: 20px;
    image-rendering: pixelated;
}

.window-header {
    background-color: var(--border-color);
    padding: 4px 8px;
    color: var(--bg-color);
    font-weight: bold;
}

.window-content {
    padding: 1rem;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
}
.window-content ul { list-style-type: ' > '; padding-left: 1rem; }
.window-content a { color: var(--glow-pink); text-decoration: none; }
.window-content a:hover { background-color: var(--glow-pink); color: var(--bg-color); }


/* --- MEDIA PLAYER & UPDATES STYLING --- */
audio { width: 100%; filter: invert(1) hue-rotate(180deg); }
.tracklist { margin-top: 1rem; border-top: 1px dashed var(--border-color); padding-top: 1rem; color: var(--glow-cyan); }
strong { color: var(--glow-cyan); }

/* --- AVATAR STYLING --- */
.avatar-container {
    /* Removes the default padding to let the image fill the space */
    padding: 0; 
}

.avatar-container img {
    display: block; /* Removes any weird spacing below the image */
    width: 100%;    /* Makes the image fit the window's width */
    height: auto;   /* Maintains the correct aspect ratio */
    image-rendering: smooth;
}

/* --- DYNAMIC CONTENT STYLING --- */
/* By default, hide all the content "screens" */
.content-section {
    display: none;
}

/* Only show the section that has the 'active' class */
.content-section.active {
    display: block;
}

#gallery-grid {
    display: grid;
    /* Create responsive columns: they'll be at least 120px wide */
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.gallery-item {
    /* background-color: rgba(0,0,0,0.2); */
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    text-align: center;
    cursor: pointer;
    /* transition: background-color 0.2s; */
}

.gallery-item {
    /* We'll use flexbox to position the text at the bottom */
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Pushes text to the bottom */
}

.gallery-item-info {
    padding-top: 0.5rem;
}

.gallery-item-info p {
    margin: 0;
    line-height: 1.2;
}

.gallery-item-info .caption {
    font-family: var(--font-body);
    font-size: 14px;
    word-wrap: break-word;
}

.gallery-item-info .filename {
    font-family: var(--font-pixel);
    font-size: 14px;
    opacity: 0.7; /* Make filename a bit more subtle */
    margin-top: 4px;
}

.gallery-item:hover {
    background-color: var(--primary-color); /* Use a theme color */
    color: var(--bg-color);
}

.gallery-item img {
    width: 100%;
    height: 100px; /* Fixed height for a uniform look */
    object-fit: cover; 
    margin-bottom: 0.5rem;
    image-rendering: smooth;
}

.gallery-item span {
    font-family: var(--font-pixel);
    font-size: 14px;
    word-wrap: break-word; /* Prevents long filenames from breaking layout */
}


/* --- NEW: LIGHTBOX STYLES --- */
#lightbox {
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
}

#lightbox.hidden {
    display: none;
}

.lightbox-content {
    position: relative;
    max-width: 85vw;
    max-height: 85vh;
    text-align: center;
}

#lightbox-img {
    max-width: 100%;
    max-height: 80vh; /* Leave space for caption */
    border: 3px solid var(--border-color);
}

#lightbox-caption {
    margin-top: 1rem;
    color: #fff;
    font-family: var(--font-body);
    font-size: 1.2rem;
}

/* Lightbox Controls */
.lightbox-close, .lightbox-prev, .lightbox-next {
    position: absolute;
    color: #fff;
    font-size: 3rem;
    cursor: pointer;
    user-select: none; /* Prevents text selection on click */
    transition: color 0.2s;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover {
    color: var(--glow-pink);
}

.lightbox-close {
    top: 1rem;
    right: 2rem;
}

.lightbox-prev {
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
}

.lightbox-next {
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
}

.album-art {
    width: 100%;
    height: auto;
    border: 2px solid var(--border-color);
    margin-bottom: 1rem;
    image-rendering: auto; /* Keeps album art smooth */
}

.track-info {
    text-align: center;
    margin-bottom: 1rem;
}

.track-title {
    font-family: var(--font-pixel);
    font-size: 22px;
    color: var(--glow-cyan);
    margin: 0;
}

.track-artist {
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--text-color);
    margin: 0.25rem 0 0 0;
}

/* --- NEW: FAVORITE CHARACTERS (SHRINE) STYLES --- */

#shrine-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* This creates the space between each character window */
}

/* --- Final, Definitive Shrine Styles --- */

/* 1. The main container for a character entry. */
/* This is the magic fix for the container height! */
.shrine-item {
    display: flow-root;
}

/* 2. The character image. We float it left. */
.shrine-item img {
    width: 186px;
    height: 186px;
    object-fit: cover;
    border: 4px solid var(--smooth-cyan);
    image-rendering: smooth;
    
    /* This makes the text wrap around the image */
    float: left; 

    /* This adds space between the image and the text that wraps it */
    margin-right: 1rem;
    margin-bottom: 0.5rem; 
}

/* 3. The container for all the text. No special styles needed. */
.shrine-item-text {
}

/* 4. The optional quote paragraph */
.shrine-quote {
    margin: 0 0 1em 0; /* Space below the quote */
    opacity: 0.85;
}

.shrine-quote em {
    font-style: italic;
}

/* --- NEW: PLAYLIST / TRACK SELECTOR STYLES --- */
.playlist-container {
    margin-top: 1rem;
    border-top: 2px dashed var(--border-color);
    padding-top: 1rem;
}

.playlist-container h3 {
    font-family: var(--font-pixel);
    font-size: 18px;
    color: var(--text-color);
    margin: 0 0 0.5rem 0;
    text-align: center;
}

#playlist {
    max-height: 150px; /* Limit the height of the list */
    overflow-y: auto;  /* Add a scrollbar if the list is too long! */
    border: 1px solid var(--border-color);
    padding: 0.5rem;
    background-color: rgba(0,0,0,0.2);
}

.playlist-item {
    padding: 0.5rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(145, 145, 145, 0.2);
    transition: background-color 0.2s;

    display: flex;
    justify-content: space-between; /* Pushes artist to the far right */
    align-items: center;            /* Vertically aligns them nicely */
}

.playlist-item:last-child {
    border-bottom: none;
}

.playlist-item:hover {
    background-color: rgba(240, 151, 195, 0.3); /* A subtle pink hover */
}

/* This style highlights the currently playing song in the list */
.playlist-item.playing {
    background-color: var(--glow-pink);
    color: var(--bg-color);
    font-weight: bold;
}

.playlist-item .item-title {
    font-family: var(--font-body);
    flex-grow: 1;
}

.playlist-item .item-artist {
    font-family: var(--font-body);
    opacity: 0.7;
    font-size: 14px;
    text-align: right;
}

#volume-slider {
    -webkit-appearance: none; /* Removes default Chrome/Safari styling */
    appearance: none;
    width: 100%; /* Make it fill the width */
    height: 8px; /* Set a height for the track */
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    outline: none;
    margin-top: 1rem;
    cursor: pointer;
}

/* --- Styling the slider "thumb" (the part you drag) --- */
#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background-color: var(--glow-cyan);
    border-radius: 50%; /* Makes it a circle */
    border: 2px solid var(--bg-color);
}

#volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background-color: var(--glow-cyan);
    border-radius: 50%;
    border: 2px solid var(--bg-color);
}

.badge-container {
    display: grid;
    /* Create two columns of equal size */
    grid-template-columns: 1fr 1fr;
    /* Center the badges horizontally in their cells */
    justify-items: center;
    /* Center the badges vertically in their cells */
    align-items: center;
    /* Set the space between badges */
    gap: 8px;
}

/* --- NEW: RESPONSIVE DESIGN FOR MOBILE --- */
@media (max-width: 900px) {
    .page-layout {
        /* On small screens, switch to a single column */
        grid-template-columns: 1fr;
        /* Stack all areas vertically */
        grid-template-areas:
            "banner"
            "main"
            "left"
            "right";
    }

    .site-banner h1 {
        font-size: 3rem; /* Make banner text smaller on mobile */
    }
}