/* =========================================================================
                                  BACKGROUND
   ========================================================================= */
   
body {
    background-color: #080808;
    color: #00ff00;
    font-family: 'Courier New', Courier, monospace;
    margin: 0;
    padding: 20px;

    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 25px;

    height: calc(100vh - 40px);
    box-sizing: border-box;

    text-shadow:
      0 0 6px rgba(0, 255, 0, 0.65),
      0 0 2px rgba(0, 255, 0, 0.3);
}



/* =========================================================================
                                  SIDEBAR
   ========================================================================= */
   
.sidebar {
    background-color: transparent;
    padding: 10px;
    overflow-y: auto;
    user-select: none;

    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar::-webkit-scrollbar {
    display: none;
}

.dir-header-dark {
    font-style: italic;
    color: #007700;
    line-height: 1.4;
}

.dir-header-green {
    color: #00ff00;
    line-height: 1.4;
}

.divider {
    color: #00ff00;
    margin: 15px 0;
}

.tree-root {
    line-height: 1.6;
    white-space: pre;
    color: #00ff00;
}

.tree-root span {
    cursor: pointer;
}

.tree-root span:hover {
    background-color: rgba(0, 255, 0, 0.15);
}



/* =========================================================================
                              MAIN CONSOLE
   ========================================================================= */
   
.console-panel {
    border: 2px solid #00ff00;
    background-color: #0c0c0c;
    padding: 15px;

    overflow-y: auto;

    box-sizing: border-box;
    position: relative;
    text-align: left;

    /* Hide scrollbar while preserving scrolling */
    scrollbar-width: none;
    -ms-overflow-style: none;

    box-shadow:
        inset 0 0 10px rgba(0, 255, 0, 0.2),
        inset 0 -20px 20px -20px rgba(0, 255, 0, 0.15);
}

.console-panel::-webkit-scrollbar {
    display: none;
}



/* =========================================================================
                            TERMINAL AND CONTENT
   ========================================================================= */

#terminal-view {
    text-align: left;
}

#content-view {
    display: none;
    text-align: left;
}

#history {
    display: block;
    text-align: left;
    white-space: pre-wrap;
    line-height: 1.4;
}

#content-body {
    padding: 15px 0;
    line-height: 1.5;
    color: #00ff00;
}



/* =========================================================================
                                  INPUT
   ========================================================================= */
   
.input-line {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.prompt {
    color: #00ff00;
    margin-right: 10px;
    user-select: none;
}

#user-input {
    background: transparent;
    border: none;

    color: #00ccff;
    font-family: inherit;
    font-size: inherit;

    outline: none;
    flex-grow: 1;

    text-shadow:
        0 0 7px rgba(0, 204, 255, 0.7),
        0 0 2px rgba(0, 204, 255, 0.4);
}



/* =========================================================================
                                TEXT COLORS
   ========================================================================= */
   
.c-cmd {
    color: #00ccff;
    font-weight: bold;

    text-shadow:
        0 0 7px rgba(0, 204, 255, 0.7),
        0 0 2px rgba(0, 204, 255, 0.4);
}

.c-desc {
    color: #ff9900;

    text-shadow:
        0 0 7px rgba(255, 153, 0, 0.7),
        0 0 2px rgba(255, 153, 0, 0.4);
}

.c-sys {
    color: #00ff00;
}



/* =========================================================================
                            CONTENT HEADERS
   ========================================================================= */

.display-header {
    display: flex;
    justify-content: space-between;
    align-items: center;

    font-weight: bold;
    margin-bottom: 5px;
    color: #00ff00;
}

.close-btn {
    background: transparent;
    color: #00ff00;

    border: none;
    padding: 0 5px;

    font-family: inherit;
    font-weight: bold;
    font-size: 1.1em;

    cursor: pointer;
}

.close-btn:hover {
    background-color: rgba(0, 255, 0, 0.2);
}



/* =========================================================================
                            CRT OVERLAY
   ========================================================================= */

.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;

    width: 100vw;
    height: 100vh;

    background:
        linear-gradient(
            rgba(18, 16, 16, 0) 50%,
            rgba(0, 0, 0, 0.30) 50%
        ),
        linear-gradient(
            90deg,
            rgba(255, 0, 0, 0.04),
            rgba(0, 255, 0, 0.01),
            rgba(0, 0, 255, 0.04)
        );

    background-size: 100% 4px, 6px 100%;

    z-index: 9999;
    pointer-events: none;
}

.crt-overlay::before {
    content: "";

    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            rgba(18, 16, 16, 0) 0%,
            rgba(0, 255, 0, 0.02) 20%,
            rgba(0, 255, 0, 0.04) 50%,
            rgba(0, 255, 0, 0.02) 80%,
            rgba(18, 16, 16, 0) 100%
        );

    background-size: 100% 40px;

    animation: crt-roll 8s linear infinite;

    pointer-events: none;
}

.crt-overlay::after {
    content: "";

    position: fixed;
    inset: 0;

    background:
        radial-gradient(
            circle,
            rgba(0, 0, 0, 0) 68%,
            rgba(0, 0, 0, 0.55) 100%
        );

    pointer-events: none;
}

@keyframes crt-roll {

    0% {
        background-position: 0 -40px;
    }

    100% {
        background-position: 0 100vh;
    }

}



/* =========================================================================
                                  MEDIA
   ========================================================================= */

.mediabox {
    border: 1px solid #00ff00;
    outline: 1px solid #585858;
    background: rgba(0, 255, 0, 0.02);
    box-shadow: inset 0 0 5px rgba(0, 255, 0, 0.1);

    padding: 15px;
    margin-bottom: 20px;

    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr)); 
    gap: 15px;
}

.item {
    position: relative;
    border-radius: 4px;
    transition: z-index 0.3s step-start;
    z-index: 1;
}

.item:hover {
    z-index: 10; 
    transition: z-index 0s;
}

.item.portrait {
    aspect-ratio: 2 / 3; 
}

.item.landscape {
    aspect-ratio: 16 / 9;
}

.mediabox img {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    object-position: center;
    border-radius: 4px;

    filter: drop-shadow(2px 2px 1px rgba(0, 0, 0, 0.5));
    
    transition: transform 0.3s ease, filter 0.3s ease; 
}

.item:hover img.zoom {
    transform: scale(1.05);
    filter: drop-shadow(5px 10px 8px rgba(0, 0, 0, 0.4)); 
}

.hover-text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 8px;
    font-size: 0.85rem;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* Stops the text from blocking the hover trigger */
}

.item:hover .hover-text {
    opacity: 1;
}


@media (max-width: 768px) {
    /* Changes the layout from side-by-side columns to a single vertical column */
    .container {
        grid-template-columns: 1fr; 
        gap: 10px;
        height: auto; /* Allows the page to expand vertically naturally */
    }

    body {
        height: auto;
        padding: 15px;
    }

    /* Adds a little breathing room beneath the sidebar on mobile views */
    .sidebar {
        padding: 0;
        overflow-y: visible; /* Prevents nested scrolling panels on mobile */
    }

    .console-panel {
        padding: 0;
        overflow-y: visible;
    }
}