/* Main Layout Setup */
.explorer-layout {
    display: flex;
    flex-direction: column; /* Columns break vertically into rows on mobile */
    gap: 20px;
    padding: 15px;
    flex: 1;
    min-height: 0;
    box-sizing: border-box;
    padding-bottom: 120px !important;
}

.project-directory {
    width: 100%; /* Spans full width until viewport expands */
    max-height: 200px; /* Restricts memory list footprint on phone screens */
    border: 1px solid var(--accent-orange);
    background: rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    padding: 10px;
    min-height: 0;
}

.project-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto; 
    min-height: 0;
    min-width: 0;
    padding-right: 5px;
}

.file-list {
    list-style: none;
    padding: 0;
}

#project-search {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--accent-orange);
    color: var(--accent-orange);
    padding: 5px;
    font-family: monospace;
    outline: none;
}

#project-search::placeholder {
    color: rgba(255, 122, 26, 0.5);
}

#project-search:focus {
    box-shadow: 0 0 10px rgba(255, 122, 26, 0.5);
    background: rgba(255, 122, 26, 0.1);
}

#proj-img {
    display: block;
    max-width: 100%;
    height: auto;
    margin-top: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--accent-orange);
    flex-shrink: 0;
}

.gallery-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
    padding-bottom: 40px;
}

.gallery-item {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    
    /* Default: 2 columns on small/mobile screens (accounting for the 15px gap) */
    width: calc(50% - 8px); 
    box-sizing: border-box;
}

.gallery-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;   /* Locks the frame to a horizontal game-screenshot shape */
    object-fit: contain;      /* Fills the box cleanly without distortion */
    border: 1px solid var(--accent-orange);
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-caption {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--accent-orange);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.gallery-item:hover .gallery-thumb {
    border-color: #fff;
    box-shadow: 0 0 10px var(--accent-orange);
}

.compact-portfolio-footer {
    display: flex;
    flex-direction: column;         /* Stacks the links line over the copyright line */
    align-items: flex-start;        /* Keeps everything aligned to the left orange border */
    bottom: 0;
    
    width: 100%;
    margin: 60px auto 0 auto;
    padding: 20px 25px;             /* Clean padding inside the green box */
    box-sizing: border-box;
    
    background: var(--card-bg);
    border-top: 2px solid var(--accent-orange); /* Signature vertical accent line */
    font-family: 'Courier New', Courier, monospace;

    position: fixed;
    left: 50%;          /* Centers the 80%-width block horizontally on the screen */
    transform: translateX(-50%);
    z-index: 999;
}

.sidebar-link {
    color: var(--accent-orange);
    transition: all 0.3s ease;
}

.sidebar-link:hover {
    text-decoration: underline;
    color: #fff;
    text-shadow: 0 0 8px var(--accent-orange);
}

.search-box {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 122, 26, 0.3);
    margin-bottom: 10px;
}

#project-list.collapsed {
    display: none !important;
}
