:root {
  color-scheme: dark;
  --bg: #07050f;
  --surface: rgba(12, 8, 24, 0.82);
  --surface-solid: #120a1e;
  --border: rgba(0, 255, 255, 0.22);
  --border-hot: rgba(255, 0, 128, 0.45);
  --text: #eef6ff;
  --muted: #9aa8c7;
  --accent: #00f5ff;
  --accent-hover: #7fffff;
  --magenta: #ff2da3;
  --magenta-dim: #c0167a;
  --danger: #ff4d6d;
  --success: #39ffb8;
  --glow-cyan: 0 0 24px rgba(0, 245, 255, 0.35);
  --glow-pink: 0 0 28px rgba(255, 45, 163, 0.35);
  font-family: "Rajdhani", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255, 45, 163, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(0, 245, 255, 0.1), transparent 50%),
    radial-gradient(ellipse 50% 40% at 0% 80%, rgba(120, 0, 255, 0.12), transparent 45%),
    var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

.grid-bg {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 245, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 245, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black 0%, transparent 85%);
  pointer-events: none;
  z-index: 0;
}

.scanlines {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.015) 0,
    rgba(255, 255, 255, 0.015) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 9999;
  opacity: 0.35;
}

.container {
  position: relative;
  z-index: 1;
  max-width: 980px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.header-banner {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--glow-cyan), inset 0 0 60px rgba(0, 245, 255, 0.06);
}

.header-art {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center 20%;
  filter: saturate(1.15) contrast(1.05);
}

.header-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(
    to top,
    rgba(7, 5, 15, 0.92) 0%,
    rgba(7, 5, 15, 0.45) 55%,
    transparent 100%
  );
}

.eyebrow {
  margin: 0 0 0.35rem;
  font-family: "Orbitron", sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: var(--glow-cyan);
}

.header h1 {
  margin: 0 0 0.25rem;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(1.35rem, 4vw, 2rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--accent), #fff 40%, var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 12px rgba(0, 245, 255, 0.35));
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 500;
}

.card {
  margin-top: 1.25rem;
  background: var(--surface);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow:
    var(--glow-pink),
    0 20px 50px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#files-view {
  position: relative;
}

.drop-zone {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.82);
  border: 2px dashed rgba(0, 245, 255, 0.55);
  box-shadow:
    inset 0 0 48px rgba(0, 245, 255, 0.12),
    var(--glow-cyan);
  pointer-events: none;
}

.drop-zone-content {
  text-align: center;
  padding: 1.5rem;
}

.drop-zone-title {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: 0 0 16px rgba(0, 245, 255, 0.4);
}

.drop-zone-hint {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.hidden {
  display: none !important;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(140px, 220px) 1fr;
  gap: 1.25rem;
  align-items: stretch;
}

.login-art-wrap {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-hot);
  min-height: 260px;
  box-shadow: var(--glow-pink);
}

.login-art {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.login-art-glow {
  position: absolute;
  inset: auto 0 0;
  height: 45%;
  background: linear-gradient(to top, rgba(255, 45, 163, 0.35), transparent);
  pointer-events: none;
}

.login-panel h2 {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--magenta);
}

.login-hint {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

#login-form {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

input[type="password"],
input[type="text"] {
  flex: 1;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.45);
  color: var(--text);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="password"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--glow-cyan);
}

button,
.upload-btn {
  border: none;
  border-radius: 8px;
  padding: 0.8rem 1.15rem;
  background: linear-gradient(135deg, var(--magenta), var(--magenta-dim));
  color: #fff;
  font-family: "Orbitron", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--glow-pink);
  transition: transform 0.15s, filter 0.15s;
}

button:hover,
.upload-btn:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

button.secondary,
.upload-btn.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
  box-shadow: none;
}

button.secondary:hover {
  background: rgba(0, 245, 255, 0.08);
  box-shadow: var(--glow-cyan);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(0, 245, 255, 0.12);
}

.toolbar-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  color: var(--muted);
  font-weight: 600;
  font-size: 1.3rem;
}

.breadcrumb button {
  background: transparent;
  color: var(--accent);
  padding: 0.25rem 0.4rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: none;
  text-transform: none;
  font-family: "Rajdhani", sans-serif;
  font-size: inherit;
}

.breadcrumb-home {
  font-size: 1.69rem;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.browse-section,
.images-section {
  margin-top: 1.5rem;
}

.section-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  width: 100%;
  height: 100px;
  margin-bottom: 0.85rem;
  padding-left: 1rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(0, 245, 255, 0.22);
  box-shadow:
    inset 0 0 24px rgba(0, 245, 255, 0.06),
    0 0 12px rgba(0, 245, 255, 0.04);
  background: rgba(0, 0, 0, 0.35);
}

.images-section .section-banner {
  border-color: rgba(255, 45, 163, 0.28);
  box-shadow:
    inset 0 0 24px rgba(255, 45, 163, 0.08),
    0 0 12px rgba(255, 45, 163, 0.05);
}

.section-title {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  z-index: 1;
  pointer-events: none;
  text-align: center;
  font-family: "Orbitron", sans-serif;
  font-size: 1.07rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
  text-shadow: 0 0 12px rgba(0, 245, 255, 0.35);
}

.images-section .section-title {
  color: var(--magenta);
  text-shadow: 0 0 12px rgba(255, 45, 163, 0.35);
}

.browse-section .section-banner {
  justify-content: flex-start;
  padding-left: 0;
  padding-right: 1rem;
}

.browse-section .section-banner-art {
  justify-content: flex-start;
}

.browse-section .section-banner-art img {
  transform: scaleX(-1);
  object-position: left center;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 28%);
  mask-image: linear-gradient(to right, transparent 0%, black 28%);
}

.section-banner-art {
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
  height: 100%;
}

.section-banner-art img {
  display: block;
  height: 100px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: right center;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 22%);
  mask-image: linear-gradient(to right, transparent 0%, black 22%);
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.image-grid .empty {
  grid-column: 1 / -1;
}

.image-card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.75rem;
  border: 1px solid rgba(255, 45, 163, 0.22);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.32);
  box-shadow: inset 0 0 24px rgba(255, 45, 163, 0.05);
}

.image-preview {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(0, 245, 255, 0.18);
  background: rgba(0, 0, 0, 0.45);
}

.image-title {
  font-weight: 700;
  font-size: 0.95rem;
  word-break: break-word;
  line-height: 1.2;
}

.image-meta {
  margin: 0;
  font-size: 0.85rem;
}

.image-actions {
  display: flex;
  gap: 0.45rem;
  justify-content: center;
  margin-top: auto;
}

.image-actions button,
.file-actions button {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.65rem;
  font-size: 0.68rem;
}

button.danger {
  background: linear-gradient(135deg, #ff4d6d, #c9184a);
  box-shadow: 0 0 16px rgba(255, 77, 109, 0.25);
}

button.danger:hover {
  filter: brightness(1.1);
}

button.compact-btn {
  letter-spacing: 0.06em;
}

.file-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(0, 245, 255, 0.14);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.file-actions {
  display: flex;
  gap: 0.45rem;
  justify-content: flex-end;
}

.file-actions button {
  flex: 0 1 auto;
}

.file-row:hover {
  border-color: rgba(255, 45, 163, 0.35);
  box-shadow: inset 0 0 20px rgba(255, 45, 163, 0.06);
}

.file-row.directory {
  cursor: pointer;
}

.file-name {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  min-width: 0;
  font-weight: 600;
  font-size: 1.05rem;
}

.file-name span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta {
  color: var(--muted);
  font-size: 0.92rem;
  white-space: nowrap;
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 2rem 1rem;
  font-size: 1.05rem;
}

.error {
  color: var(--danger);
  margin-top: 0.75rem;
  text-shadow: 0 0 10px rgba(255, 77, 109, 0.4);
}

.status {
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  background: rgba(0, 245, 255, 0.1);
  color: var(--accent);
  border: 1px solid rgba(0, 245, 255, 0.2);
}

.status.success {
  background: rgba(57, 255, 184, 0.1);
  color: var(--success);
  border-color: rgba(57, 255, 184, 0.25);
}

.status.error {
  background: rgba(255, 77, 109, 0.1);
  color: var(--danger);
  border-color: rgba(255, 77, 109, 0.25);
}

.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.72);
}

.confirm-dialog,
.prompt-dialog {
  width: min(100%, 420px);
  padding: 1.25rem;
  border-radius: 14px;
  background: rgba(12, 8, 24, 0.96);
}

.confirm-dialog {
  border: 1px solid rgba(255, 77, 109, 0.35);
  box-shadow: var(--glow-pink);
}

.prompt-dialog {
  border: 1px solid rgba(0, 245, 255, 0.35);
  box-shadow: var(--glow-cyan);
}

.dialog-message {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.45;
}

.prompt-dialog input[type="text"] {
  width: 100%;
  margin-top: 0.85rem;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.45);
  color: var(--text);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.prompt-dialog input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--glow-cyan);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.15rem;
}

@media (max-width: 720px) {
  .header-art {
    height: 160px;
  }

  .login-layout {
    grid-template-columns: 1fr;
  }

  .login-art-wrap {
    max-height: 220px;
    min-height: 180px;
  }

  .login-art {
    min-height: 180px;
  }
}

@media (max-width: 900px) {
  .image-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .section-banner {
    height: 72px;
    padding-left: 0.75rem;
    gap: 0.65rem;
  }

  .section-title {
    font-size: 0.94rem;
    letter-spacing: 0.1em;
  }

  .section-banner-art img {
    height: 72px;
  }

  .file-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .image-grid {
    grid-template-columns: 1fr;
  }

  #login-form {
    flex-direction: column;
  }
}
