/* Geofile — explorer.css
   The window chrome (title bar, controls, borders, body background) comes
   from XP.css. This file only styles what XP.css doesn't:
     • toolbar (back/forward, view chips, address bar, search)
     • sidebar with location/topic shortcuts
     • content area with folder/file icons + grid/list layouts
   .explorer-pane positioning + window-body padding override live in desktop.css. */

/* ── Toolbar ───────────────────────────────────────────────────────────── */
.ex-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  background: linear-gradient(180deg, #F4F2E4 0%, #ECE9D8 100%);
  border-bottom: 1px solid #ACA899;
  flex-shrink: 0;
}
.ex-nav-buttons { display: flex; gap: 2px; }
.ex-nav-btn {
  appearance: none; -webkit-appearance: none;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #FAFAFA 0%, #ECECE0 50%, #C9C7BA 100%);
  border: 1px solid #ACA899;
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
  cursor: default;
  color: #000;
  transition: background 80ms;
}
.ex-nav-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #FFFDE0 0%, #FFEFB0 50%, #FFD96C 100%);
  border-color: #E0A040;
}
.ex-nav-btn:active:not(:disabled) {
  background: linear-gradient(180deg, #DCD9C8 0%, #ECE9D8 50%, #F4F2E4 100%);
}
.ex-nav-btn:disabled { color: #ACA899; opacity: 0.7; }
.ex-nav-btn svg { width: 12px; height: 12px; }

.ex-view-chips {
  display: flex;
  background: transparent;
  padding: 0;
  gap: 2px;
  margin-left: 2px;
}
.ex-view-chip {
  appearance: none; -webkit-appearance: none;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #FAFAFA 0%, #ECECE0 50%, #C9C7BA 100%);
  border: 1px solid #ACA899;
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
  cursor: default;
  color: #000;
}
.ex-view-chip:hover {
  background: linear-gradient(180deg, #FFFDE0 0%, #FFEFB0 50%, #FFD96C 100%);
  border-color: #E0A040;
}
.ex-view-chip.is-active,
.ex-view-chip:active {
  background: linear-gradient(180deg, #C2D7F2 0%, #B0CAE8 50%, #98B6DA 100%);
  border-color: #5680C5;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.15);
}
.ex-view-chip svg { width: 12px; height: 12px; }

/* Address bar — sunken white input, classic XP. */
.ex-path {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  height: 24px;
  background: #FFFFFF;
  border: 1px solid #7F9DB9;
  border-radius: 2px;
  box-shadow: inset 1px 1px 1px rgba(0,0,0,0.08);
  padding: 2px 6px;
  overflow-x: auto;
  scrollbar-width: none;
  font-size: 11px;
  color: #000;
}
.ex-path::-webkit-scrollbar { display: none; }
.ex-path-crumb {
  appearance: none; -webkit-appearance: none;
  background: transparent;
  border: none;
  padding: 2px 6px;
  border-radius: 2px;
  cursor: default;
  color: #000;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  font-size: 11px;
  font-family: inherit;
}
.ex-path-crumb:hover { background: #316AC5; color: #fff; }
.ex-path-crumb.is-current { font-weight: 700; }
.ex-path-crumb.is-current:hover { background: transparent; color: #000; }
.ex-path-sep { color: #888; font-size: 10px; padding: 0 1px; }
.ex-path-flag { font-size: 12px; line-height: 1; }

.ex-search {
  position: relative;
  width: 180px;
  flex-shrink: 0;
}
.ex-search input {
  width: 100%;
  height: 24px;
  padding: 0 8px;
  background: #FFFFFF;
  border: 1px solid #7F9DB9;
  border-radius: 2px;
  box-shadow: inset 1px 1px 1px rgba(0,0,0,0.08);
  font: inherit;
  font-size: 11px;
  color: #000;
}
.ex-search input::placeholder { color: #999; }

/* ── Body: sidebar + content ───────────────────────────────────────────── */
.ex-body {
  display: flex;
  flex: 1;
  min-height: 0;
  background: #ECE9D8;
  gap: 0;
}
/* Authentic XP "task pane" sidebar — blue gradient column with rounded
   white panels stacked inside. Each panel has a gradient-blue header
   (rounded top) showing the section title, then a list of items styled
   as small icon + blue text link with hover underline. */
.ex-sidebar {
  width: 200px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #7DA2CE 0%, #5A88BD 50%, #4F7AB0 100%);
  padding: 10px 8px;
  overflow-y: auto;
  font-size: 11px;
  color: #ffffff;
  border-right: 1px solid #294D80;
}
.ex-sidebar-section {
  margin-bottom: 10px;
  background: #FFFFFF;
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 5px 5px 4px 4px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.18);
}
/* Each section's header bar — gradient-blue strip with a chevron + title.
   Faked via ::before on the first .ex-sidebar-item, so we don't have to
   restructure the rendered HTML. */
.ex-sidebar-section::before {
  content: attr(data-title);
  display: block;
  padding: 4px 8px 4px 22px;
  background: linear-gradient(180deg, #DFEAFA 0%, #C5D9F4 100%);
  border-bottom: 1px solid #B3CBE4;
  color: #1B4A8F;
  font-weight: 700;
  font-size: 11px;
  position: relative;
}
/* Chevron caret in the header. */
.ex-sidebar-section::after {
  content: '▼';
  position: absolute;
  margin-top: -18px;
  margin-left: 6px;
  width: 12px;
  height: 12px;
  background: linear-gradient(180deg, #FFFFFF 0%, #D5E4F5 100%);
  border: 1px solid #7E9FCB;
  border-radius: 2px;
  font-size: 7px;
  color: #1B4A8F;
  text-align: center;
  line-height: 11px;
}
.ex-sidebar-item {
  appearance: none; -webkit-appearance: none;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 3px 10px;
  background: transparent;
  border: none;
  cursor: default;
  font: inherit;
  font-size: 11px;
  color: #1B4A8F;
  text-align: left;
}
.ex-sidebar-item:hover {
  text-decoration: underline;
  background: transparent;
}
.ex-sidebar-item.is-active {
  color: #000;
  font-weight: 700;
  background: rgba(49,106,197,0.10);
}
.ex-sidebar-icon {
  font-size: 13px;
  line-height: 1;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  color: inherit;
}
.ex-sidebar-count {
  margin-left: auto;
  font-size: 10px;
  color: #5A7AAA;
  font-variant-numeric: tabular-nums;
}

/* ── Content area ──────────────────────────────────────────────────────── */
.ex-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border-left: 1px solid #ACA899;
  overflow: hidden;
}
.ex-content-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 16px;
  min-height: 240px;
  background: #FFFFFF;
}

/* Grid view. */
.ex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 14px 10px;
}
.ex-item {
  appearance: none; -webkit-appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 4px;
  background: transparent;
  border: 1px dotted transparent;
  border-radius: 3px;
  cursor: default;
  font: inherit;
  font-size: 11px;
  text-align: center;
  position: relative;
  transition: background 80ms;
}
.ex-item:hover { background: rgba(49,106,197,0.10); }
.ex-item.is-selected {
  background: rgba(49,106,197,0.18);
  border-color: rgba(49,106,197,0.5);
}
.ex-item-name {
  font-size: 11px;
  line-height: 1.25;
  color: #000;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
  padding: 1px 4px;
  border-radius: 2px;
}
.ex-item.is-selected .ex-item-name {
  background: #316AC5;
  color: #fff;
}

/* ── Folder icon — authentic XP yellow folder (SVG sprite) ───────────── */
/* The actual shape comes from the inline <symbol id="ico-folder"> in
   index.html. Every folder is identical; only the text label below
   distinguishes them, matching real-XP behaviour. */
.ex-folder-icon {
  width: 38px;
  height: 32px;
  margin-bottom: 2px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.20));
}

/* ── File icon ─────────────────────────────────────────────────────────── */
.ex-file-icon {
  position: relative;
  width: 30px;
  height: 38px;
  margin-bottom: 2px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #FFFFFF 0%, #F0F0F0 100%);
  border: 1px solid #B0B0B0;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.10);
}
.ex-file-icon::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 9px; height: 9px;
  background: linear-gradient(135deg, #F0F0F0 0%, #D0D0D0 100%);
  border-left: 1px solid #B0B0B0;
  border-bottom: 1px solid #B0B0B0;
  border-radius: 0 2px 0 2px;
}
.ex-file-icon::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 0; height: 0;
  border-style: solid;
  border-width: 0 0 9px 9px;
  border-color: transparent transparent rgba(0,0,0,0.06) transparent;
}
.ex-file-glyph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  padding-top: 6px;
}

/* ── List view (compact: small icon + name only) ──────────────────────── */
.ex-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.ex-list .ex-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 2px 8px;
  text-align: left;
}
.ex-list .ex-item .ex-folder-icon,
.ex-list .ex-item .ex-file-icon {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
}
.ex-list .ex-item .ex-file-icon::before { width: 5px; height: 5px; }
.ex-list .ex-item .ex-file-icon::after  { border-width: 0 0 5px 5px; }
.ex-list .ex-item .ex-file-glyph { font-size: 9px; padding-top: 2px; }
.ex-list .ex-item-name {
  font-size: 11px;
  text-align: left;
  -webkit-line-clamp: 1;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* ── Media (Commons) tiles — wider, with thumbnail images ──────────────── */
.ex-grid-media {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 16px 12px;
}
.mv-tile .mv-tile-thumbwrap {
  width: 110px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  border: 1px solid #B0B0B0;
  padding: 3px;
  margin-bottom: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
  overflow: hidden;
}
.mv-tile-thumb {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
}
.mv-tile-placeholder {
  font-size: 36px;
  color: #888;
}

/* ── Media Viewer body ─────────────────────────────────────────────────── */
.mv-body { background: #202020 !important; padding: 0 !important; }
.mv-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  padding: 20px;
  background: #202020;
}
.mv-image, .mv-video {
  max-width: 100%;
  max-height: 80vh;
  display: block;
  border: 1px solid #000;
}
.mv-audio-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 40px;
  color: #eee;
}
.mv-audio-glyph { font-size: 80px; opacity: 0.7; }
.mv-audio { width: min(380px, 80%); }
.mv-desc {
  background: #2C2C2C;
  color: #DDD;
  padding: 10px 16px;
  font-size: 12px;
  line-height: 1.4;
  border-top: 1px solid #000;
}

/* ── Empty + loading ──────────────────────────────────────────────────── */
.ex-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: #5A5A5A;
  text-align: center;
  font-size: 11px;
  gap: 8px;
}
.ex-empty-glyph { font-size: 36px; }
.ex-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: #5A5A5A;
  font-size: 11px;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .ex-sidebar { display: none; }
  .ex-search { display: none; }
  .ex-toolbar { gap: 2px; padding: 3px 4px; }
  .ex-content-scroll { padding: 10px 12px 12px; }
  .ex-grid { grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 10px 8px; }
}
