/* ==========================================================================
   Windows-Style File Explorer Styles (Fluent Dark Acrylic)
   ========================================================================== */

.explorer-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  padding: 16px;
  animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.explorer-window {
  width: 100%;
  max-width: 1240px;
  height: 86vh;
  min-height: 520px;
  background: linear-gradient(135deg, rgba(14, 20, 32, 0.96) 0%, rgba(8, 12, 22, 0.98) 100%);
  border: 1px solid rgba(94, 234, 212, 0.28);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(94, 234, 212, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.explorer-window.fullscreen {
  max-width: 100vw;
  height: 100vh;
  border-radius: 0;
  border: none;
}

/* --------------------------------------------------------------------------
   1. Windows Titlebar
   -------------------------------------------------------------------------- */

.explorer-titlebar {
  height: 40px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  user-select: none;
}

.titlebar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.explorer-app-icon {
  color: var(--accent);
  font-size: 15px;
}

.explorer-window-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.2px;
}

.window-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.win-btn {
  width: 32px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 4px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 11px;
  transition: all 0.15s ease;
}

.win-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.win-btn.win-btn-close:hover {
  background: #ef4444;
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   2. Windows Explorer Toolbar & Address Bar
   -------------------------------------------------------------------------- */

.explorer-toolbar {
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-buttons-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tool-btn {
  height: 32px;
  min-width: 32px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tool-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(94, 234, 212, 0.4);
}

.tool-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.tool-btn.active {
  background: rgba(94, 234, 212, 0.2);
  border-color: var(--accent);
  color: var(--accent);
}

.tool-btn-labeled span {
  font-weight: 600;
  font-size: 12px;
}

/* Address Bar / Breadcrumb */
.explorer-address-bar {
  flex: 1;
  min-width: 260px;
  height: 34px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 6px;
  position: relative;
  transition: border-color 0.2s ease;
}

.explorer-address-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(94, 234, 212, 0.2);
}

.address-icon {
  color: var(--accent);
  font-size: 13px;
  padding-left: 2px;
}

.breadcrumb-trail {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
}

.breadcrumb-trail::-webkit-scrollbar {
  display: none;
}

.crumb-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.crumb-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.crumb-item.current {
  color: #ffffff;
  font-weight: 700;
}

.crumb-separator {
  color: var(--faint);
  font-size: 10px;
}

.manual-path-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #0d1320;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: #ffffff;
  padding: 0 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  outline: none;
}

.address-copy-btn {
  background: transparent;
  border: none;
  color: var(--faint);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 12px;
  transition: color 0.15s ease;
}

.address-copy-btn:hover {
  color: var(--accent);
}

/* Search Box */
.toolbar-right-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.explorer-search-box {
  width: 190px;
  height: 34px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 6px;
}

.explorer-search-box:focus-within {
  border-color: var(--accent);
}

.search-icon {
  color: var(--faint);
  font-size: 11px;
}

.explorer-search-box input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 12px;
  outline: none;
  width: 100%;
}

.search-clear-btn {
  background: transparent;
  border: none;
  color: var(--faint);
  cursor: pointer;
  font-size: 11px;
}

.search-clear-btn:hover {
  color: var(--hot);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.view-switch-group {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.view-switch-group .tool-btn {
  border: none;
  border-radius: 0;
}

/* --------------------------------------------------------------------------
   3. Body Layout : Sidebar & Main Area
   -------------------------------------------------------------------------- */

.explorer-body {
  flex: 1;
  display: flex;
  min-height: 0;
  position: relative;
}

/* Sidebar */
.explorer-sidebar {
  width: 250px;
  background: rgba(0, 0, 0, 0.3);
  border-right: 1px solid var(--line);
  padding: 14px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex-shrink: 0;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--faint);
  letter-spacing: 0.6px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.sidebar-nav-item i {
  color: var(--accent);
  font-size: 13px;
  width: 16px;
  text-align: center;
}

.sidebar-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.sidebar-nav-item.active {
  background: rgba(94, 234, 212, 0.16);
  color: var(--accent);
  font-weight: 600;
}

/* Drives list in sidebar */
.sidebar-drives-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 4px;
}

.drive-card-mini {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.15s ease;
}

.drive-card-mini:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(94, 234, 212, 0.4);
}

.drive-card-mini.active {
  border-color: var(--accent);
  background: rgba(94, 234, 212, 0.12);
}

.drive-mini-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drive-mini-head i {
  color: var(--accent);
  font-size: 14px;
}

.drive-mini-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drive-mini-bar {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.drive-mini-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.drive-mini-fill.hot {
  background: #ef4444;
}

.drive-mini-text {
  font-size: 10.5px;
  color: var(--faint);
  display: flex;
  justify-content: space-between;
}

/* --------------------------------------------------------------------------
   4. Main Content Area (Grid & Details Table)
   -------------------------------------------------------------------------- */

.explorer-main {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  position: relative;
  background: rgba(5, 8, 15, 0.4);
}

/* Grid View */
.explorer-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}

.file-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 12px 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  position: relative;
  user-select: none;
  transition: all 0.15s ease;
}

.file-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(94, 234, 212, 0.25);
  transform: translateY(-2px);
}

.file-card.selected {
  background: rgba(94, 234, 212, 0.18);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(94, 234, 212, 0.25);
}

.file-icon-box {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  font-size: 32px;
  margin-bottom: 8px;
}

.file-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-all;
  line-height: 1.35;
}

.file-meta-sub {
  font-size: 10.5px;
  color: var(--faint);
  margin-top: 4px;
}

/* Table / Details View */
.explorer-list-container {
  width: 100%;
  overflow-x: auto;
}

.explorer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.explorer-table thead th {
  text-align: left;
  padding: 8px 12px;
  color: var(--faint);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  user-select: none;
  cursor: pointer;
}

.explorer-table thead th:hover {
  color: var(--text);
}

.explorer-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: background 0.15s ease;
}

.explorer-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.06);
}

.explorer-table tbody tr.selected {
  background: rgba(94, 234, 212, 0.15);
}

.explorer-table td {
  padding: 8px 12px;
  color: var(--text);
  white-space: nowrap;
}

.table-file-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.table-file-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.table-actions-cell {
  display: flex;
  gap: 6px;
}

.table-action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--muted);
  width: 26px;
  height: 26px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-size: 11px;
  cursor: pointer;
  text-decoration: none;
}

.table-action-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* File Icon Color Themes */
.icon-folder { color: #fbbf24; }
.icon-python { color: #38bdf8; }
.icon-js { color: #fde047; }
.icon-ts { color: #60a5fa; }
.icon-html { color: #fb923c; }
.icon-css { color: #38bdf8; }
.icon-json { color: #a78bfa; }
.icon-bash { color: #4ade80; }
.icon-config { color: #94a3b8; }
.icon-db { color: #f472b6; }
.icon-txt { color: #cbd5e1; }
.icon-md { color: #38bdf8; }
.icon-pdf { color: #f87171; }
.icon-data { color: #34d399; }
.icon-log { color: #fb923c; }
.icon-image { color: #c084fc; }
.icon-audio { color: #f43f5e; }
.icon-video { color: #10b981; }
.icon-archive { color: #eab308; }
.icon-package { color: #a855f7; }
.icon-exe { color: #ec4899; }
.icon-default { color: #94a3b8; }

/* States (Loading, Empty, Error) */
.explorer-state-view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  text-align: center;
  padding: 20px;
}

.state-icon {
  font-size: 40px;
  color: var(--accent);
}

.state-icon.error {
  color: var(--hot);
}

.state-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.state-subtitle {
  font-size: 13px;
  color: var(--faint);
}

.state-action-btn {
  margin-top: 8px;
}

/* --------------------------------------------------------------------------
   5. Statusbar
   -------------------------------------------------------------------------- */

.explorer-statusbar {
  height: 28px;
  background: rgba(0, 0, 0, 0.5);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  font-size: 11px;
  color: var(--faint);
  user-select: none;
}

.statusbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-separator {
  color: rgba(255, 255, 255, 0.1);
}

/* --------------------------------------------------------------------------
   6. Previewer Modal (Code, Text, Image, Audio)
   -------------------------------------------------------------------------- */

.preview-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 20px;
}

.preview-modal-window {
  width: 100%;
  max-width: 900px;
  height: 75vh;
  background: #090d16;
  border: 1px solid rgba(94, 234, 212, 0.4);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
}

.preview-modal-header {
  height: 44px;
  background: #0e1422;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.preview-file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.preview-size-badge {
  font-size: 11px;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
}

.preview-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.preview-modal-body {
  flex: 1;
  overflow: auto;
  padding: 16px;
  background: #06090f;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-code-block {
  width: 100%;
  height: 100%;
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #e2e8f0;
  white-space: pre;
  overflow: auto;
  tab-size: 4;
}

.preview-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.preview-audio-player {
  width: 100%;
  max-width: 450px;
}

/* --------------------------------------------------------------------------
   7. Mkdir Sub-Modal
   -------------------------------------------------------------------------- */

.mkdir-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 20px;
}

.mkdir-modal-window {
  width: 100%;
  max-width: 420px;
  background: #0f1523;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}

.mkdir-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mkdir-modal-header h3 {
  margin: 0;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.mkdir-modal-header h3 i {
  color: var(--accent);
}

.mkdir-form input {
  height: 40px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: #ffffff;
  font-size: 13px;
  outline: none;
}

.mkdir-form input:focus {
  border-color: var(--accent);
}

/* --------------------------------------------------------------------------
   8. Responsive Design
   -------------------------------------------------------------------------- */

@media (max-width: 860px) {
  .explorer-sidebar {
    width: 200px;
  }
  .explorer-search-box {
    width: 140px;
  }
}

@media (max-width: 680px) {
  .explorer-sidebar {
    display: none;
  }
  .explorer-modal-backdrop {
    padding: 0;
  }
  .explorer-window {
    height: 100vh;
    border-radius: 0;
  }
}
