:root {
    --bg-main: #1e1e1e;
    --bg-panel: #252526;
    --bg-hover: #2a2d2e;
    --border: #3e3e42;
    --text-main: #cccccc;
    --text-muted: #858585;
    --accent: #094771;
    --accent-hover: #0d5e96;
    --link: #4fc1ff;
    --folder: #dcb67a;
    --modal-bg: rgba(0, 0, 0, 0.6);
}

body {
    background: var(--bg-main); color: var(--text-main); font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    font-size: 13px; margin: 0; padding: 20px; display: flex; justify-content: center; height: 100vh; box-sizing: border-box;
}

.explorer {
    width: 100%; max-width: 1200px; background: var(--bg-panel); border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5); display: flex; flex-direction: column; overflow: hidden;
}

/* Toolbar & Breadcrumbs */
.toolbar {
    padding: 8px 12px; background: #333; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; gap: 15px; align-items: center; flex-wrap: wrap;
}
.nav-controls { display: flex; align-items: center; gap: 10px; flex-grow: 1; overflow: hidden; }
.breadcrumbs { display: flex; align-items: center; white-space: nowrap; overflow-x: auto; font-family: Consolas, monospace; font-size: 12px; padding: 4px 0; }
.crumb-link { color: var(--text-main); text-decoration: none; cursor: pointer; padding: 2px 4px; border-radius: 3px; }
.crumb-link:hover { background: rgba(255,255,255,0.1); color: #fff; }
.crumb-sep { color: var(--text-muted); margin: 0 4px; font-weight: bold; }
.crumb-current { color: #fff; padding: 2px 4px; }

.icon-btn { background: transparent; border: none; color: var(--text-main); cursor: pointer; display: flex; align-items: center; padding: 6px; border-radius: 3px; }
.icon-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
svg { fill: currentColor; }

/* Sleek Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 5px;
    border: 2px solid var(--bg-main);
}
::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Search Box */
.search-container { position: relative; width: 250px; }
.search-icon { position: absolute; left: 8px; top: 7px; width: 12px; height: 12px; fill: var(--text-muted); }
.search-box {
    width: 100%; background: #3c3c3c; border: 1px solid #555; padding: 5px 10px 5px 28px;
    color: #fff; font-family: inherit; font-size: 12px; outline: none; box-sizing: border-box; border-radius: 2px;
}
.search-box:focus { border-color: var(--link); }

/* Table View */
.file-view { overflow-y: auto; flex-grow: 1; }
table { width: 100%; border-collapse: collapse; text-align: left; table-layout: fixed; }
th { background: var(--bg-main); color: var(--text-main); font-weight: normal; padding: 6px 12px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); position: sticky; top: 0; font-size: 12px; z-index: 10; }
th:last-child { border-right: none; }
td { padding: 8px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; user-select: none; }
tr:hover td { background: var(--bg-hover); }

.col-name { width: 70%; }
.col-type { width: 15%; }
.col-size { width: 15%; }

.item-wrapper { display: flex; align-items: center; gap: 8px; }
.item-icon { width: 16px; height: 16px; flex-shrink: 0; }
.folder .item-icon { color: var(--folder); }
.file .item-icon { color: var(--link); }
.empty { text-align: center; color: var(--text-muted); padding: 40px; font-style: italic; cursor: default; }

/* Modal Styles */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: var(--modal-bg); backdrop-filter: blur(3px);
    z-index: 100; justify-content: center; align-items: center; padding: 20px;
}
.modal-overlay.active { display: flex; }
.modal-content {
    background: var(--bg-panel); border: 1px solid var(--border); border-radius: 6px; width: 100%; max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); display: flex; flex-direction: column; overflow: hidden;
}
.modal-header { padding: 15px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: #333; }
.modal-header h3 { margin: 0; font-size: 14px; font-weight: normal; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 90%; }
.close-btn { background: transparent; border: none; color: var(--text-muted); font-size: 16px; cursor: pointer; }
.close-btn:hover { color: #fff; }
.modal-body { padding: 15px; display: flex; flex-direction: column; gap: 10px; }

.action-btn {
    display: flex; align-items: center; gap: 10px; padding: 12px; background: #3c3c3c; border: 1px solid #555;
    color: var(--text-main); text-decoration: none; border-radius: 4px; font-size: 13px; font-family: inherit; cursor: pointer; transition: 0.1s;
}
.action-btn:hover { background: #555; color: #fff; }
.action-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.action-btn.primary:hover { background: var(--accent-hover); }
.action-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Toast */
#toast {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: var(--link); color: #000;
    padding: 10px 20px; font-size: 13px; font-weight: 500; display: none; box-shadow: 0 4px 6px rgba(0,0,0,0.3); border-radius: 4px; z-index: 1000;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    body { padding: 0; height: 100dvh; }
    .explorer { border: none; border-radius: 0; height: 100%; box-shadow: none; }
    .search-container { width: 100%; }
    .col-type { display: none; }
    .col-name { width: 75%; }
    .col-size { width: 25%; font-size: 12px; }
    td { padding: 12px 15px; } /* Larger touch targets for mobile */
}