/* 
 * File Explorer - Thunar-like
 * For Nelson Lombardo's portfolio
 * Standalone draggable window (no overlay) — usable alongside bash console.
 */

/* === FILE EXPLORER WINDOW === */
.file-explorer {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    width: 820px;
    height: 540px;
    background: rgba(30, 30, 55, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.6),
        0 0 60px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
    position: fixed;
    z-index: 1999;
    animation: windowOpen 0.2s ease-out;
}

.file-explorer.open {
    display: flex;
}

.file-explorer.active-window {
    z-index: 2000;
}

@keyframes windowOpen {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* === WINDOW TITLE BAR === */
.fe-title-bar {
    display: flex;
    align-items: center;
    height: 38px;
    background: linear-gradient(180deg, rgba(45, 45, 68, 0.9) 0%, rgba(30, 30, 50, 0.9) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px 12px 0 0;
    padding: 0 12px;
    user-select: none;
    cursor: grab;
    flex-shrink: 0;
    position: relative;
}

.fe-title-bar:active {
    cursor: grabbing;
}

.fe-title-buttons {
    display: flex;
    gap: 8px;
    margin-right: 12px;
}

.fe-title-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: filter 0.15s;
}

.fe-title-btn:hover {
    filter: brightness(1.3);
}

.fe-title-btn.close { background: #ff5f56; }
.fe-title-btn.minimize { background: #ffbd2e; }
.fe-title-btn.maximize { background: #27c93f; }

.fe-title-text {
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    flex: 1;
    margin-right: 88px;
}

/* === TOOLBAR === */
.fe-toolbar {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.fe-toolbar-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.fe-toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
}

.fe-toolbar-btn:active {
    background: rgba(255, 255, 255, 0.15);
}

.fe-toolbar-separator {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 4px;
}

.fe-path-bar {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    padding: 3px 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
    min-height: 26px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    user-select: none;
}

.fe-path-bar span {
    color: rgba(255, 255, 255, 0.5);
    margin: 0 2px;
}

.fe-path-bar .fe-path-sep {
    color: rgba(255, 255, 255, 0.25);
}

.fe-path-bar .fe-path-current {
    color: #33ff33;
}

/* === MAIN CONTENT AREA (sidebar + files) === */
.fe-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* === SIDEBAR === */
.fe-sidebar {
    width: 180px;
    min-width: 180px;
    background: rgba(0, 0, 0, 0.15);
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    padding: 6px 0;
    overflow-y: auto;
    flex-shrink: 0;
}

.fe-sidebar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.1s;
    user-select: none;
}

.fe-sidebar-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
}

.fe-sidebar-item.active {
    background: rgba(51, 255, 51, 0.1);
    color: #33ff33;
}

.fe-sidebar-item .icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.fe-sidebar-section {
    color: rgba(255, 255, 255, 0.25);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 12px 4px;
    font-weight: 600;
}

/* === FILE LISTING === */
.fe-file-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
    background: rgba(0, 0, 0, 0.08);
}

.fe-file-header {
    display: flex;
    padding: 4px 12px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    position: sticky;
    top: 0;
    background: rgba(30, 30, 55, 0.95);
    z-index: 1;
    user-select: none;
}

.fe-file-header span {
    padding: 2px 4px;
}

.fe-file-header .col-name { flex: 1; }
.fe-file-header .col-size { width: 80px; text-align: right; }
.fe-file-header .col-type { width: 120px; }
.fe-file-header .col-modified { width: 130px; text-align: right; }

.fe-file-item {
    display: flex;
    align-items: center;
    padding: 5px 12px;
    cursor: pointer;
    transition: background 0.08s;
    user-select: none;
}

.fe-file-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.fe-file-item.selected {
    background: rgba(51, 255, 51, 0.08);
}

.fe-file-item:active {
    background: rgba(51, 255, 51, 0.12);
}

.fe-file-item .icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
    margin-right: 6px;
}

.fe-file-item .icon img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    vertical-align: middle;
}

.fe-file-item .col-name {
    flex: 1;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fe-file-item .col-name.dir {
    color: #70f0ff;
    font-weight: 500;
}

.fe-file-item .col-name.image {
    color: #ff8c00;
}

.fe-file-item .col-name.file {
    color: rgba(255, 255, 255, 0.7);
}

.fe-file-item .col-size {
    width: 80px;
    text-align: right;
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    font-family: 'Cascadia Code', 'Consolas', monospace;
}

.fe-file-item .col-type {
    width: 120px;
    color: rgba(255, 255, 255, 0.35);
    font-size: 12px;
}

.fe-file-item .col-modified {
    width: 130px;
    text-align: right;
    color: rgba(255, 255, 255, 0.35);
    font-size: 12px;
}

/* === STATUS BAR === */
.fe-statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.35);
    font-size: 11px;
    flex-shrink: 0;
    user-select: none;
}

/* === IMAGE PREVIEW (lightbox) === */
.fe-image-preview {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
}

.fe-image-preview.open {
    display: flex;
}

.fe-image-preview img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    object-fit: contain;
}

.fe-image-preview .close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 32px;
    cursor: pointer;
    transition: color 0.15s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
}

.fe-image-preview .close-btn:hover {
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
}

.fe-image-preview .img-info {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 16px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    user-select: none;
}

/* === SCROLLBAR === */
.fe-sidebar::-webkit-scrollbar,
.fe-file-list::-webkit-scrollbar {
    width: 6px;
}

.fe-sidebar::-webkit-scrollbar-track,
.fe-file-list::-webkit-scrollbar-track {
    background: transparent;
}

.fe-sidebar::-webkit-scrollbar-thumb,
.fe-file-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.fe-sidebar::-webkit-scrollbar-thumb:hover,
.fe-file-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* === EMPTY STATE === */
.fe-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255, 255, 255, 0.2);
    font-size: 14px;
    gap: 8px;
}

.fe-empty .icon {
    font-size: 48px;
    opacity: 0.5;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
    .file-explorer {
        width: calc(100% - 24px);
        height: calc(100vh - 100px);
        max-height: 600px;
    }
    
    .fe-sidebar {
        width: 140px;
        min-width: 140px;
    }
    
    .fe-file-header .col-type,
    .fe-file-item .col-type {
        display: none;
    }
    
    .fe-title-text {
        font-size: 12px;
        margin-right: 0;
    }
}

@media (max-width: 600px) {
    .fe-sidebar {
        display: none;
    }
    
    .fe-file-header .col-modified,
    .fe-file-item .col-modified {
        display: none;
    }
    
    .fe-file-header .col-size,
    .fe-file-item .col-size {
        width: 60px;
    }
}
