/* -------------------------------------------------------------------
   GLOBAL STYLES & LAYOUT
   ------------------------------------------------------------------- */
body,
html {
    height: 100%;
    margin: 0;
    overflow: hidden;
    background-color: #000;
    font-family: "Arial", sans-serif;
    color: #ccc;
}

/* -------------------------------------------------------------------
   STARTUP ANIMATION
   ------------------------------------------------------------------- */
.startup-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    color: #fff;
    font-size: 3em;
    font-weight: bold;
    display: none; /* Hidden by default, shown via JavaScript */
    opacity: 0;
    animation:
        startup-fade-in 1.5s ease-out forwards,
        startup-wait 1.5s 1.5s forwards,
        startup-fade-out 1s 3s forwards;
}
@keyframes startup-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
@keyframes startup-wait {
    from {
        opacity: 1;
    }
    to {
        opacity: 1;
    }
}
@keyframes startup-fade-out {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* -------------------------------------------------------------------
   THREE.JS CONTAINER BACKGROUND
   ------------------------------------------------------------------- */
#threejs-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    opacity: 0;
    transition: opacity 2s ease-in-out;
}
.show-ribbons {
    opacity: 1 !important;
}

/* -------------------------------------------------------------------
   XMB LAYOUT
   ------------------------------------------------------------------- */
#xmb-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 50;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 1.5s ease-in,
        visibility 1.5s;
}

/* --- 1. Primary Navigation (Icons Only - Horizontal) --- */
#horizontal-tabs {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
}
#horizontal-tabs button {
    display: flex;
    justify-content: center;
    align-items: center;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.5em;
    width: 70px;
    height: 70px;
    margin: 0 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    border-radius: 5px;
}
#horizontal-tabs button:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.05);
}
#horizontal-tabs button.active {
    color: #00c0ff;
    font-size: 2em;
    transform: scale(1.1);
    text-shadow: 0 0 15px #00c0ff;
}

/* --- 2. Content Viewport (The static window for content) --- */
#content-viewport {
    flex-grow: 1;
    overflow: hidden;
    position: relative;
    width: 100%;
    height: calc(100vh - 100px);
}

/* --- 3. Content Track (The element that moves horizontally) --- */
#content-track {
    display: flex;
    position: absolute;
    top: 0;
    left: 0;
    width: 600%;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}

/* --- 4. Content Panels (The vertical menu lists for each category) --- */
.content-panel {
    width: 100vw;
    flex-shrink: 0;
    padding: 20px 0;
    box-sizing: border-box;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.content-panel h3 {
    color: #00c0ff;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(0, 192, 255, 0.5);
    padding-bottom: 5px;
    text-align: center;
    display: none; /* Hide category subheadings for cleaner flow */
}

.content-item {
    display: block;
    background: none;
    border: none;
    color: #ccc;
    font-size: 1.5em;
    padding: 10px 0 10px 20px;
    cursor: pointer;
    text-align: left;
    transition:
        color 0.2s,
        border-left 0.2s,
        text-shadow 0.2s;
    width: 80%;
    max-width: 600px;
    margin-bottom: 5px;
    border-left: 4px solid transparent;
    position: relative;
    overflow: hidden;
}

.content-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background-color: rgba(0, 0, 0, 0.2);
    transition: width 0.4s ease-out;
    z-index: -1;
}

.content-item:hover::before,
.content-item.focused::before {
    width: 100%;
}

.content-item:hover,
.content-item.focused {
    color: #fff;
    border-left: 4px solid #00c0ff;
    text-shadow: 0 0 5px rgba(0, 192, 255, 0.5);
}

.content-item i {
    margin-right: 15px;
    margin-left: 10px;
    font-size: 1em;
    color: #00c0ff;
}

/* -------------------------------------------------------------------
   MODALS
   ------------------------------------------------------------------- */
#media-viewer,
#contact-modal,
#credits-modal,
#about-modal,
#blender-modal,
#music-modal,
#ai-modal,
#iframe-error-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}
#media-viewer.active,
#contact-modal.active,
#credits-modal.active,
#about-modal.active,
#blender-modal.active,
#music-modal.active,
#ai-modal.active,
#iframe-error-modal.active {
    display: flex;
}
#media-content {
    width: 80%;
    height: 80%;
    max-width: 1200px;
    max-height: 800px;
    background: #000;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    border-top: 2px solid #00c0ff;
    border-bottom: 2px solid #00c0ff;
    border-radius: 0;
    box-shadow: 0 0 20px rgba(0, 192, 255, 0.5);
}
#dynamic-media-wrapper {
    width: 100%;
    height: 100%;
    position: relative; /* Context for loading message position */
}
/* All media elements now target the new wrapper */
#dynamic-media-wrapper iframe,
#dynamic-media-wrapper video,
#dynamic-media-wrapper audio,
#dynamic-media-wrapper img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}
/* Specific styling for the audio player */
#dynamic-media-wrapper audio {
    height: auto;
    width: 80%;
    margin: 50px auto;
}

/* This is the general style for all close buttons, which is what the Account modals use */
.close-btn {
    position: absolute;
    top: 15px; /* Default top for Account modals */
    right: 15px; /* Default right for Account modals */
    background: #00c0ff50;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 10px 15px;
    cursor: pointer;
    z-index: 1001;
    font-size: 1em;
    transition: background 0.2s;
}
.close-btn:hover {
    background: #00c0ff;
}

/* This OVERRIDES the positioning ONLY for the media viewer close button (requested fix) */
#media-content > .close-btn {
    top: -40px; /* Moves it up outside the border, above the content box */
    right: 0px; /* Positions it at the right edge */
}

#contact-modal-content,
#credits-modal-content,
.info-modal-content,
#iframe-error-content {
    background: #111;
    padding: 40px;
    border-radius: 0;
    border: 2px solid #00c0ff;
    text-align: center;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}
#contact-modal-content h3,
#credits-modal-content h3,
.info-modal-content h3,
#iframe-error-content h3 {
    color: #00c0ff;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
#credits-modal-content p,
.info-modal-content p,
#iframe-error-content p {
    margin: 15px 0;
    line-height: 1.6;
}
#credits-modal-content strong,
.info-modal-content strong,
#iframe-error-content strong {
    color: #00c0ff;
}
.info-modal-content ul {
    list-style: none;
    padding: 0;
}
.info-modal-content ul li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.info-modal-content ul li:last-child {
    border-bottom: none;
}
/* NEW: Style for action buttons in error modal */
.action-btn {
    background: #00c0ff;
    color: #000;
    border: none;
    padding: 10px 20px;
    margin: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
    border-radius: 5px;
}
.action-btn:hover {
    background: #0080ff;
}
.no-btn {
    background: #333;
    color: #ccc;
}
.no-btn:hover {
    background: #555;
}
