/* Fancy Neon/Glassmorphism Theme */
:root {
  --bg: #0b0f1a;
  --bg-alt: #0e1322;
  --text: #e6e9ef;
  --muted: #9aa4b2;
  --primary: #7c3aed; /* purple */
  --primary-2: #06b6d4; /* cyan */
  --accent: #22c55e; /* green */
  --danger: #ef4444;
  --warning: #f59e0b;
  --card: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 10px 30px rgba(0,0,0,0.4);
}

/* Light mode */
html.light {
  --bg: #f7f8fb;
  --bg-alt: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --primary: #7c3aed;
  --primary-2: #06b6d4;
  --accent: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --card: rgba(0, 0, 0, 0.04);
  --border: rgba(15, 23, 42, 0.08);
  --shadow: 0 8px 24px rgba(2, 6, 23, 0.08);
}

/* Animated gradient background sheen */
body {
  background: radial-gradient(1200px 800px at 100% -10%, rgba(124,58,237,0.20), transparent),
              radial-gradient(1000px 600px at -10% 110%, rgba(6,182,212,0.18), transparent),
              linear-gradient(180deg, var(--bg), var(--bg-alt));
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  margin: 0;
  min-height: 100vh;
}

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 28px;
}

/* Glass card */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: saturate(140%) blur(10px);
  padding: 16px;
}

.card + .card { margin-top: 20px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, rgba(0,0,0,0.35), rgba(0,0,0,0));
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.site-header .inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 28px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.brand .logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: conic-gradient(from 180deg at 50% 50%, var(--primary), var(--primary-2), var(--accent), var(--primary));
  box-shadow: 0 8px 20px rgba(124,58,237,0.35), 0 2px 8px rgba(6,182,212,0.25);
}
.brand .title {
  font-size: 18px;
}

.header-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }

/* Button */
.btn {
  appearance: none;
  border: 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(124,58,237,0.95), rgba(124,58,237,0.75));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(124,58,237,0.35), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn:active { transform: translateY(0); box-shadow: 0 6px 16px rgba(124,58,237,0.25); }

.btn.secondary {
  background: linear-gradient(180deg, rgba(6,182,212,0.95), rgba(6,182,212,0.75));
  box-shadow: 0 10px 25px rgba(6,182,212,0.35), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn.danger {
  background: linear-gradient(180deg, rgba(239,68,68,0.95), rgba(239,68,68,0.75));
  box-shadow: 0 10px 25px rgba(239,68,68,0.35), inset 0 1px 0 rgba(255,255,255,0.18);
  color: #fff;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border-radius: 12px;
}
.breadcrumb a { color: var(--text); text-decoration: none; opacity: 0.9; }
.breadcrumb a:hover { opacity: 1; text-decoration: underline; }
.breadcrumb { margin-bottom: 18px; }

/* Tabs */
.tabs { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.tab {
  padding: 12px 16px;
  border-radius: 10px 10px 0 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text);
}
.tab.active {
  background: var(--card);
  border-bottom-color: transparent;
}
.tab-content {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  background: var(--card);
  margin-bottom: 22px;
}

/* Lists */
ul.file-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 18px; }
ul.file-list li { display: flex; gap: 16px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,0.04); transition: transform .15s ease, box-shadow .2s ease; position: relative; overflow: visible; }
ul.file-list li:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(2,6,23,0.25); }

.file-thumbnail { width: 128px; height: 176px; border-radius: 12px; overflow: hidden; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; box-shadow: none; }
.file-thumbnail img, .file-thumbnail video { width: 100%; height: 100%; object-fit: contain; object-position: center; display: block; background: transparent; }

.file-info-wrapper { flex: 1; min-width: 0; }
.file-info-wrapper { display: flex; flex-direction: column; gap: 6px; }
.file-info-wrapper a { color: #a78bfa; font-weight: 700; text-decoration: none; font-size: 15px; display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-actions-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.file-info-wrapper a:hover { text-decoration: underline; }
.meta { color: var(--muted); font-size: 13px; margin-top: 6px; line-height: 1.6; }

.icon { font-size: 46px; width: 60px; text-align: center; color: #60a5fa; }
.icon.folder { color: #f59e0b; }

.private-item { background: rgba(245, 158, 11, 0.08); border: 1px dashed rgba(245,158,11,0.35); }

/* Forms */
.form-container.card h3 { margin-top: 0; }
input[type="file"], input[type="text"], input[type="password"] {
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
}

/* Dropzone for uploads */
.dropzone {
  margin-top: 8px;
  padding: 28px;
  min-height: 140px;
  border: 2px dashed var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.dropzone strong { color: var(--text); }
.dropzone.dragover {
  border-color: var(--primary-2);
  background: rgba(6,182,212,0.08);
  box-shadow: 0 10px 28px rgba(6,182,212,0.15);
}

/* Comfortable spacing inside forms */
.form-container form > * { margin-bottom: 12px; }
.form-container label { display: inline-block; margin: 6px 0; }
.form-container .cancel-button { margin-left: 8px; }

/* Progress */
.progress-bar { width: 100%; height: 24px; background: rgba(255,255,255,0.05); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-2)); }
.progress-text { font-weight: 800; }

/* Utility */
.row { display: flex; gap: 12px; align-items: center; }
.gap { height: 16px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
hr.sep { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

/* Download overlay */
.download-progress { background: var(--card); border: 1px solid var(--border); }
.download-progress .close-btn { color: var(--muted); }

/* Theme toggle */
.theme-toggle {
  position: relative;
  width: 44px;
  height: 28px;
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
}
.theme-toggle .dot {
  position: absolute;
  top: 3px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff, #cbd5e1);
  transition: transform .2s ease;
}
html.light .theme-toggle .dot { transform: translateX(14px); }

/* Footer */
.site-footer { color: var(--muted); font-size: 12px; padding: 24px; text-align: center; }

/* Headings and global rhythm */
h1, h2, h3 { line-height: 1.25; margin: 0 0 10px; }
h1 { font-size: 28px; }
h2 { font-size: 20px; margin-top: 6px; margin-bottom: 14px; }

/* Action bar spacing */
.action-buttons { gap: 12px; margin: 10px 0 18px; flex-wrap: wrap; }


/* Media viewer sizing */
.media-container { display: flex; align-items: center; justify-content: center; }
.media-preview {
  max-width: 100%;
  max-height: calc(100vh - 240px);
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.media-video { width: 100%; height: auto; max-height: calc(100vh - 240px); }

/* Bulk selection UI */
.bulk-controls { display: none; }
.bulk-form.bulk-mode .bulk-controls { display: flex; }
.bulk-checkbox, .bulk-master {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
  cursor: pointer;
}
.bulk-checkbox:hover, .bulk-master:hover { filter: brightness(1.05); }
.bulk-checkbox:active, .bulk-master:active { transform: scale(0.98); }
.bulk-checkbox:checked, .bulk-master:checked {
  background: linear-gradient(180deg, rgba(124,58,237,0.95), rgba(6,182,212,0.85));
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(124,58,237,0.35), inset 0 1px 0 rgba(255,255,255,0.2);
}
.bulk-checkbox::after, .bulk-master::after {
  content: '';
  position: absolute;
  display: none;
}
.bulk-checkbox:checked::after, .bulk-master:checked::after {
  display: block;
  width: 12px; height: 12px;
  left: 4px; top: 4px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path d='M2 7l2 2 6-6' stroke='white' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/12px 12px no-repeat;
}

/* Overlay position for item checkboxes */
.bulk-checkbox { position: absolute; top: 8px; left: 8px; display: none; z-index: 3; box-shadow: 0 8px 18px rgba(2,6,23,0.35); }
.bulk-form.bulk-mode .bulk-checkbox { display: inline-block; }
.bulk-form.bulk-mode ul.file-list li { padding-left: 44px; }


