:root {
  --bg-color: #0f0f0f;
  --panel-bg: #1a1a1a;
  --text-color: #ffffff;
  --accent-color: #00ffff;
  --muted-color: #b9d9d9;
  --border-glow: 0 0 10px rgba(0, 255, 255, 0.35);
}

body.light-mode {
  --bg-color: #f4f8fb;
  --panel-bg: #ffffff;
  --text-color: #111111;
  --accent-color: #0077cc;
  --muted-color: #4e5d69;
  --border-glow: 0 0 10px rgba(0, 119, 204, 0.18);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: 'Pacifico', cursive;
  background: var(--bg-color);
  color: var(--text-color);
  font-size: 18px;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body {
  line-height: 1.45;
}

.theme-toggle {
  position: fixed;
  top: 12px;
  right: 18px;
  background: var(--panel-bg);
  color: var(--accent-color);
  padding: 8px 12px;
  border-radius: 10px;
  box-shadow: var(--border-glow);
  z-index: 1100;
}

.theme-toggle input {
  margin-left: 8px;
  transform: scale(1.1);
  cursor: pointer;
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--panel-bg);
  color: var(--accent-color);
  padding: 14px 0;
  text-align: center;
  box-shadow: var(--border-glow);
  z-index: 1000;
}

.navbar a {
  color: var(--accent-color);
  margin: 0 14px;
  text-decoration: none;
}

.navbar a:hover,
.sidebar-link:hover,
.pagination-container a:hover,
a:hover {
  color: #ffffff;
  text-shadow: 0 0 8px var(--accent-color);
}

.links-sidebar {
  position: fixed;
  top: 64px;
  bottom: 0;
  width: 19%;
  overflow-y: auto;
  padding: 18px 10px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0, 0, 0, 0.15);
}

.left-sidebar { left: 0; }
.right-sidebar { right: 0; }

.sidebar-link {
  margin: 12px 0 8px;
  font-size: 20px;
  font-weight: bold;
  text-align: center;
  word-break: break-word;
  color: var(--accent-color);
  text-decoration: none;
  transition: transform 0.25s ease, text-shadow 0.25s ease;
}

.sidebar-image {
  width: 110px;
  max-width: 100%;
  height: auto;
  margin: 8px 0 18px;
  border-radius: 8px;
  box-shadow: var(--border-glow);
  transition: transform 0.25s ease;
}

.sidebar-image:hover,
.sidebar-link:hover {
  transform: scale(1.04);
}

.container {
  width: 62%;
  margin: 100px auto 40px;
  padding: 0 20px 40px;
}

.card-panel {
  background: var(--panel-bg);
  border-radius: 16px;
  box-shadow: var(--border-glow);
  padding: 18px;
}

h1 {
  font-size: 48px;
  color: var(--accent-color);
  text-align: center;
  text-shadow: 0 0 10px var(--accent-color), 0 0 22px rgba(0, 255, 255, 0.45);
  margin: 0 0 10px;
}

h2 {
  font-size: 30px;
  color: var(--accent-color);
  text-shadow: 0 0 6px var(--accent-color);
  margin-top: 0;
}

.intro-text {
  text-align: center;
  color: var(--muted-color);
  margin: 0 0 20px;
}

.status-banner {
  margin: 0 0 20px;
  padding: 12px 16px;
  border-radius: 12px;
  text-align: center;
  box-shadow: var(--border-glow);
}

.status-success {
  background: rgba(0, 128, 0, 0.2);
}

.status-error {
  background: rgba(160, 0, 0, 0.25);
}

.settings,
.upload-container,
.folder-tabs,
.iframe-container {
  margin-bottom: 20px;
}

.settings {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.settings label,
.form-group label {
  color: var(--accent-color);
}

.settings select,
.upload-form select,
.upload-form input[type="file"],
.upload-form input[type="submit"],
.folder-tab {
  padding: 8px 12px;
  border-radius: 10px;
  border: none;
  background: #111;
  color: var(--accent-color);
  box-shadow: var(--border-glow);
}

body.light-mode .settings select,
body.light-mode .upload-form select,
body.light-mode .upload-form input[type="file"],
body.light-mode .upload-form input[type="submit"],
body.light-mode .folder-tab {
  background: #f0f6fb;
}

.upload-form {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: end;
  justify-content: center;
}

.form-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.form-group-file {
  min-width: 280px;
}

.folder-tabs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.folder-tab {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.folder-tab.active,
.folder-tab:hover,
.upload-form input[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 14px rgba(0, 255, 255, 0.45);
}

.table-container {
  display: none;
  margin-top: 20px;
}

.table-container.active {
  display: block;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  background: var(--panel-bg);
  color: var(--text-color);
  box-shadow: var(--border-glow);
  border-radius: 14px;
  overflow: hidden;
}

th,
td {
  border: 1px solid rgba(0, 255, 255, 0.25);
  padding: 10px;
  text-align: left;
  vertical-align: middle;
}

tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

a {
  color: var(--accent-color);
}

td.file-audio::before { content: '🎵 '; }
td.file-image::before { content: '🖼️ '; }
td.file-video::before { content: '🎬 '; }
td.file-pdf::before { content: '📄 '; }
td.file-txt::before { content: '📃 '; }
td.file-zip::before { content: '🗜️ '; }
td.file-default::before { content: '📁 '; }

.thumbnail {
  max-width: 100px;
  border-radius: 8px;
}

.preview {
  max-width: 160px;
}

audio {
  width: 100%;
  max-width: 220px;
}

.muted {
  color: var(--muted-color);
}

.iframe-container {
  width: 100%;
  height: 600px;
}

.iframe-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 12px;
  background: var(--panel-bg);
}

@media (max-width: 1100px) {
  .links-sidebar {
    display: none;
  }

  .container {
    width: min(96%, 960px);
    margin: 96px auto 30px;
  }
}

@media (max-width: 768px) {
  html, body {
    font-size: 16px;
  }

  .theme-toggle {
    position: static;
    margin: 78px auto 10px;
    width: fit-content;
  }

  .navbar {
    padding: 12px 10px;
  }

  .navbar a {
    display: inline-block;
    margin: 4px 8px;
  }

  .container {
    margin-top: 20px;
    padding: 0 12px 24px;
  }

  h1 {
    font-size: 36px;
  }

  .upload-form,
  .settings {
    flex-direction: column;
    align-items: stretch;
  }

  .form-group,
  .form-group-file {
    width: 100%;
    min-width: 0;
  }

  table {
    font-size: 14px;
  }
}
