* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; font-family: Tahoma, Verdana, Geneva, sans-serif; color: #1c3656; font-size: 12px; }

body {
  background:
    radial-gradient(circle at 20% 10%, #e8f4ff 0%, transparent 50%),
    radial-gradient(circle at 80% 90%, #b4dcf5 0%, transparent 55%),
    linear-gradient(to bottom, #d9ecf9 0%, #a9cde8 100%);
  display: grid;
  grid-template-rows: 36px 1fr 24px;
  grid-template-columns: 200px 1fr;
  grid-template-areas:
    "nav  nav"
    "side main"
    "foot foot";
}

/* --- Nav / breadcrumb --- */
.nav {
  grid-area: nav;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  background: linear-gradient(to bottom, rgba(215, 235, 250, 0.38) 0%, rgba(175, 210, 235, 0.42) 100%);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid rgba(75, 120, 180, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.nav-btn {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(75, 120, 180, 0.55);
  border-radius: 4px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.7), rgba(220,235,250,0.55));
  color: #1c3656;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}
.nav-btn:hover { background: linear-gradient(to bottom, rgba(255,255,255,0.85), rgba(220,235,250,0.7)); }
.nav-btn:active { background: linear-gradient(to bottom, rgba(170,200,230,0.5), rgba(210,230,245,0.7)); }
.nav-btn:disabled { opacity: 0.4; cursor: default; }

.crumbs {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: 999px;
  padding: 4px 12px;
  font-family: "Lucida Console", "Consolas", Tahoma, monospace;
  font-size: 11px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.7),
    inset 0 -1px 0 rgba(0,30,70,0.08);
  min-width: 0;
  overflow: hidden;
}
.crumbs .crumb {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
}
.crumbs .crumb:hover { background: rgba(75,120,180,0.15); }
.crumbs .sep { opacity: 0.5; padding: 0 2px; user-select: none; }

.view-modes {
  display: flex;
  gap: 2px;
}

/* --- Sidebar --- */
.sidebar {
  grid-area: side;
  background: linear-gradient(to bottom, rgba(225, 240, 252, 0.55) 0%, rgba(195, 220, 240, 0.5) 100%);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  border-right: 1px solid rgba(75, 120, 180, 0.35);
  overflow-y: auto;
  padding: 10px 0;
}
.section { margin-bottom: 14px; }
.section-title {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(28, 54, 86, 0.55);
  padding: 0 12px 4px;
  font-weight: 700;
}
.folder {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  cursor: pointer;
  border-left: 2px solid transparent;
  user-select: none;
}
.folder:hover { background: rgba(255, 255, 255, 0.4); }
.folder.active {
  background: linear-gradient(to right, rgba(100, 160, 220, 0.35), rgba(100, 160, 220, 0.1));
  border-left-color: #3a6bad;
  font-weight: 600;
}
.folder-icon {
  width: 16px;
  height: 13px;
  flex-shrink: 0;
  background: linear-gradient(to bottom, #ffdb8a 0%, #f4bc55 100%);
  border: 1px solid #9c6b1a;
  border-radius: 1px 3px 1px 1px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
  position: relative;
}
.folder-icon::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 2px;
  width: 7px;
  height: 3px;
  background: linear-gradient(to bottom, #ffdb8a 0%, #f4bc55 100%);
  border: 1px solid #9c6b1a;
  border-bottom: none;
  border-radius: 1px 1px 0 0;
}
.folder-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder-count {
  font-family: "Lucida Console", monospace;
  font-size: 10px;
  opacity: 0.55;
}

/* --- Main grid --- */
.main {
  grid-area: main;
  overflow-y: auto;
  padding: 16px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 14px;
}

.item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 4px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  position: relative;
}
.item:hover { background: rgba(255, 255, 255, 0.35); }
.item.selected {
  background: linear-gradient(to bottom, rgba(100, 160, 220, 0.42), rgba(100, 160, 220, 0.28));
  border: 1px solid rgba(60, 120, 190, 0.6);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}

.item-thumb {
  width: 100px;
  height: 80px;
  object-fit: cover;
  border: 1px solid rgba(28, 54, 86, 0.5);
  background: #000;
  box-shadow: 0 4px 10px -3px rgba(0, 30, 70, 0.35);
  pointer-events: none;
}
.item-name {
  font-size: 11px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}
.item-meta {
  font-size: 10px;
  font-family: "Lucida Console", monospace;
  color: rgba(28, 54, 86, 0.6);
}

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: rgba(28, 54, 86, 0.5);
  font-style: italic;
}

/* --- Status bar --- */
.statusbar {
  grid-area: foot;
  background: linear-gradient(to bottom, rgba(215, 235, 250, 0.4) 0%, rgba(175, 210, 235, 0.42) 100%);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-top: 1px solid rgba(75, 120, 180, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 11px;
  color: rgba(28, 54, 86, 0.75);
  font-family: "Lucida Console", monospace;
  gap: 12px;
}
.statusbar .sep-v {
  width: 1px;
  height: 14px;
  background: rgba(75, 120, 180, 0.4);
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 25, 50, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border: 1px solid #1c3656;
  box-shadow: 0 14px 40px rgba(0,0,0,0.5);
  cursor: default;
}
.lightbox .lb-caption {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.85);
  padding: 6px 14px;
  border-radius: 999px;
  font-family: "Lucida Console", monospace;
  font-size: 12px;
  color: #1c3656;
  border: 1px solid rgba(255,255,255,0.6);
}

/* Scrollbars — soft aero */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.2); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(to right, rgba(120,170,220,0.6), rgba(90,140,195,0.7));
  border: 1px solid rgba(75,120,180,0.4);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to right, rgba(140,185,230,0.75), rgba(110,160,210,0.85));
}
