/* ── Fonts ── */
@font-face { font-family: "vtctribal"; src: url('https://rottingwife.neocities.org/fonts/vtctribal.ttf'); }
@font-face { font-family: "uglyqua";   src: url('https://rottingwife.neocities.org/fonts/uglyqua.ttf'); }

/* ── Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── Base ── */
html, body {
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-family: Arial, sans-serif;
  background-color: #f0f2f5;
}

/* ── Animations ── */
@keyframes shake {
  0%   { transform: translate(1px, 1px)   rotate(0deg); }
  10%  { transform: translate(-1px, -2px) rotate(-1deg); }
  20%  { transform: translate(-4px, 0px)  rotate(1deg); }
  30%  { transform: translate(3px, 2px)   rotate(0.12deg); }
  40%  { transform: translate(1px, -1px)  rotate(0.69deg); }
  50%  { transform: translate(-1px, 2px)  rotate(-1.2deg); }
  60%  { transform: translate(-3px, 1px)  rotate(0deg); }
  70%  { transform: translate(3px, 1px)   rotate(-1deg); }
  80%  { transform: translate(-1px, -1px) rotate(0.86deg); }
  90%  { transform: translate(1px, 3px)   rotate(0.3deg); }
  100% { transform: translate(1px, -2px)  rotate(-1.12deg); }
}

@keyframes rotate {
  0%    { transform: translate(2px, 0px)   rotate(0deg); }
  12.5% { transform: translate(-1px, -1px) rotate(-0.69deg); }
  25%   { transform: translate(1px, 0px)   rotate(-1.3deg); }
  37.5% { transform: translate(-1px, 1px)  rotate(-0.42deg); }
  50%   { transform: translate(0px, 1px)   rotate(0deg); }
  62.5% { transform: translate(-2px, 0px)  rotate(0.9deg); }
  75%   { transform: translate(0px, 1px)   rotate(1.62deg); }
  87.5% { transform: translate(1px, 0px)   rotate(0.666deg); }
  100%  { transform: translate(1px, 0px)   rotate(0deg); }
}

/* ── Background ── */
.mybackground {
  width: 100%;
  height: 100%;
  background-image: url('https://rottingwife.neocities.org/assets/bg.gif');
  background-size: cover;
  background-position: center;
  position: relative;
}

.main-box {
  padding: 80px;
  display: flex;
  color: white;
}

/* ── Draggable windows ── */
.draggable-window {
  position: absolute;
  z-index: 10;
  cursor: grab;
  user-select: none;
}

.draggable-window:active { cursor: grabbing; }
.draggable-window * { user-select: none; }

#dancebaby { display: none; }
#prev      { display: none; }

/* ── Display bar above explorer ── */
.display {
  display: flex;
  width: auto;
  align-items: center;
  margin-top: -48px;
  margin-bottom: 20px;
}

/* ── File Explorer ── */
.file-explorer {
  display: flex;
  width: 1000px;
  height: 500px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* ── Sidebar ── */
.sidebar {
  width: 200px;
  background-color: white;
  color: black;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.sideba {
  width: 100%;
  height: 100vh;
  background-color: black;
  border-right: 1px solid #ccc;
  padding: 10px;
}

.sideba h2 {
  font-size: 14px;
  color: #555;
  margin-top: 10px;
  margin-bottom: 5px;
  padding-left: 10px;
}

.section  { margin-top: 15px; }
.divider  { border-top: 1px solid #e0e0e0; margin: 10px 0; }

.menu-item {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  margin: 2px 0;
  border-radius: 4px;
  transition: background-color 0.2s ease;
  font-size: 14px;
  color: #333;
}

.menu-item:hover { background-color: #e6f0ff; }
.menu-icon { margin-right: 10px; text-align: center; }
.ico { width: 19px; }
.na  { cursor: not-allowed; }
.aa  { cursor: pointer; }

/* ── Main content area ── */
.content {
  width: 90vw;
  flex: 1;
  background-color: #181218;
  overflow: auto;
}

/* ── Explorer header / address bar ── */
.explorer-header {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  background-color: #1a1a2e;
  border-bottom: 1px solid #333;
  gap: 6px;
}

.nav-buttons { display: flex; margin-right: 10px; }

.nav-button {
  width: 28px;
  height: 28px;
  background-color: #e1e1e1;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.nav-button:hover { background-color: #d0d0d0; }

.address-bar {
  flex: 1;
  display: flex;
  align-items: center;
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 5px 10px;
  margin-right: 10px;
}

.address-text {
  flex: 1;
  color: #333;
  font-size: 14px;
}

.back { width: 32px; cursor: pointer; }

/* ── Animated title text ── */
.titleanim span { display: inline-block; }

/* ── Home grid ── */
.grid-container {
  display: inline-grid;
  grid-template-columns: repeat(4, 1fr);
  justify-content: space-evenly;
  margin-bottom: 32px;
}

.file {
  width: 148px;
  height: 148px;
  display: flex;
  background-color: transparent;
  margin: 10px;
  padding: 8px;
  cursor: pointer;
  justify-content: center;
  word-break: break-all;
  font-size: 13px;
}

.file img   { height: 90%; display: flex; }
.file:hover { background-color: rgba(0,0,0,0.2); }

/* ── View toggle buttons ── */
.view-toggle-group {
  display: flex;
  gap: 2px;
  background: #111;
  border: 1px solid #444;
  border-radius: 3px;
  padding: 2px;
  flex-shrink: 0;
}

.view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 22px;
  background: transparent;
  border: none;
  border-radius: 2px;
  color: #888;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.view-btn:hover { background: #2a2a3e; color: #ccc; }
.view-btn.active { background: #2d4a7a; color: #fff; }

/* ── Image gallery grid — GRID MODE ── */
.image-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 8px;
  width: 100%;
  box-sizing: border-box;
}

/* Every item is a flex-column so icon is always above label */
.grid-item {
  cursor: pointer;
  border-radius: 4px;
  padding: 6px 4px;
  transition: background 0.15s;
  border: 1px solid transparent;
}
.grid-item:hover {
  background-color: rgba(60,100,200,0.18);
  border-color: rgba(60,100,200,0.35);
}
.grid-item:active { background-color: rgba(60,100,200,0.32); }

/* Inner wrapper — always column, centered */
.grid-item-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}

/* Icon/thumbnail in grid */
.grid-item-icon {
  display: block;
  width: auto;
  max-width: 100%;
  height: 90px;
  object-fit: contain;
  border-radius: 3px;
  margin-bottom: 5px;
  flex-shrink: 0;
}

/* Type icons (txt/pdf/video) — smaller so they don't dominate */
.type-icon { height: 56px; }

.grid-item-label {
  display: block;
  width: 100%;
  font-size: 11px;
  color: #ddd;
  word-break: break-word;
  line-height: 1.3;
}

.created-date {
  display: block;
  font-size: 10px;
  color: #555;
  font-style: italic;
  margin-top: 2px;
}

/* ── LIST VIEW ── */
.image-grid.list-view {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
}

.image-grid.list-view .grid-item {
  border-radius: 0;
  border: none;
  border-bottom: 1px solid #222;
  padding: 4px 10px;
}
.image-grid.list-view .grid-item:hover {
  background: rgba(60,100,200,0.18);
  border-color: #222;
}

.image-grid.list-view .grid-item-inner {
  flex-direction: row;
  align-items: center;
  text-align: left;
  gap: 10px;
}

.image-grid.list-view .grid-item-icon {
  height: 20px;
  width: 20px;
  object-fit: contain;
  margin-bottom: 0;
  flex-shrink: 0;
}

.image-grid.list-view .grid-item-label {
  flex: 1;
  font-size: 13px;
  word-break: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-grid.list-view .created-date {
  flex-shrink: 0;
  font-size: 11px;
  margin-top: 0;
  color: #555;
}

/* ── (legacy kept for compatibility) ── */

/* ── Preview window content ── */
#preview { color: black; max-height: 680px; overflow: auto; }

#preview img {
  height: 666px;
  display: block;
  margin: 0 auto;
  object-fit: contain;
}

#preview canvas {
  display: block;
  max-width: 860px;
  margin: 0 auto;
}

.txt-preview {
  font-family: monospace;
  padding: 10px;
  white-space: pre-wrap;
  color: #222;
  font-size: 13px;
  max-width: 700px;
}

.preview-err {
  padding: 12px;
  color: #c00;
  font-size: 13px;
}

/* ── PDF navigation bar ── */
#pdf-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 5px 10px;
  background: #1a1a2e;
  color: #ccc;
  font-size: 12px;
  border-top: 1px solid #333;
}

.pdf-nav-btn {
  background: #2d4a7a;
  border: 1px solid #446;
  color: #fff;
  padding: 2px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
}
.pdf-nav-btn:hover { background: #3a5c96; }
.pdf-nav-btn:disabled { opacity: 0.4; cursor: default; }

/* ── Misc ── */
.navbar {
  padding-bottom: 20px;
  font-size: 20px;
  font-weight: bold;
}

.blank-sidebar {
  width: 420px;
  height: 420px;
  background-color: #e0e0e0;
  margin-left: 80px;
}

.directory {
  margin-bottom: 2px;
  cursor: pointer;
  font-size: 20px;
  font-family: uglyqua;
  border: 0;
  background-color: transparent;
  width: 100%;
}

.directory:hover { background-color: rgba(0,0,0,0.2); width: 100%; }

/* ── Preview container (unused but kept) ── */
.preview-container { text-align: center; margin-bottom: 30px; }

.preview-container img {
  max-width: 90%;
  max-height: 400px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.preview-info { margin-top: 10px; font-size: 15px; color: #444; }

.close-button {
  margin-top: 10px;
  padding: 6px 14px;
  background-color: #f44336;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
