/* ========================================
   XVELOCITY DASHBOARD THEME
   ======================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #070b14;
  --bg-secondary: #0e1424;
  --bg-panel: rgba(18, 28, 48, 0.72);
  --bg-panel-strong: rgba(16, 24, 42, 0.9);
  --bg-hover: rgba(0, 200, 255, 0.1);

  --accent-cyan: #00d6ff;
  --accent-blue: #2b7bff;
  --accent-green: #00e0b2;

  --text-primary: #e9f4ff;
  --text-secondary: #b7c7df;
  --text-muted: #7692b7;

  --border-main: rgba(110, 156, 221, 0.24);
  --border-soft: rgba(110, 156, 221, 0.14);

  --shadow-main: 0 18px 40px rgba(0, 0, 0, 0.45);
  --glow-cyan: 0 0 24px rgba(0, 214, 255, 0.38);
  --radius-lg: 20px;
  --radius-md: 14px;
  --sidebar-width: 248px;
}

body.light-theme {
  --bg-primary: #eff5ff;
  --bg-secondary: #dfe9fb;
  --bg-panel: rgba(255, 255, 255, 0.86);
  --bg-panel-strong: rgba(255, 255, 255, 0.94);
  --bg-hover: rgba(43, 123, 255, 0.1);

  --accent-cyan: #007eab;
  --accent-blue: #2b5eff;

  --text-primary: #12233f;
  --text-secondary: #2b3f5e;
  --text-muted: #5f7798;

  --border-main: rgba(74, 110, 170, 0.3);
  --border-soft: rgba(74, 110, 170, 0.16);

  --shadow-main: 0 16px 30px rgba(22, 45, 81, 0.16);

  color: #111827;
  background:
    radial-gradient(circle at 8% 12%, rgba(0, 126, 171, 0.12), transparent 40%),
    radial-gradient(circle at 96% 86%, rgba(43, 94, 255, 0.1), transparent 44%),
    linear-gradient(135deg, var(--bg-primary), #f7fbff 45%, var(--bg-secondary));
}

html,
body {
  min-height: 100%;
}

body {
  font-family: 'Rajdhani', 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at 8% 12%, rgba(0, 214, 255, 0.18), transparent 40%),
    radial-gradient(circle at 96% 86%, rgba(43, 123, 255, 0.14), transparent 44%),
    linear-gradient(135deg, var(--bg-primary), #090f1d 45%, var(--bg-secondary));
  color: var(--text-primary);
  overflow-x: hidden;
}

body.light-theme .glitch-title,
body.light-theme .brand-text h1,
body.light-theme .menu-btn,
body.light-theme .sidebar-link,
body.light-theme .quick-link,
body.light-theme .menu-item,
body.light-theme .welcome-message h2,
body.light-theme .item-info h4,
body.light-theme .file-item h4,
body.light-theme .view-btn,
body.light-theme .download-btn,
body.light-theme .modal-btn {
  color: #111827;
}

body.light-theme .glitch-title,
body.light-theme .logo {
  text-shadow: none;
}

.dashboard-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-panel-strong);
  border-right: 1px solid var(--border-main);
  box-shadow: var(--shadow-main), inset -1px 0 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 18px 14px;
  z-index: 30;
  display: flex;
  flex-direction: column;
}

.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 214, 255, 0.09), transparent 20%, transparent 80%, rgba(0, 214, 255, 0.06));
  pointer-events: none;
}

.sidebar-header {
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 16px;
  border-bottom: 1px solid var(--border-soft);
}

.logo {
  font-family: 'Orbitron', monospace;
  font-size: 28px;
  font-weight: 800;
  color: var(--accent-cyan);
  text-shadow: var(--glow-cyan);
  letter-spacing: 2px;
}

.brand-text h1 {
  font-family: 'Orbitron', monospace;
  font-size: 16px;
  letter-spacing: 1.2px;
}

.brand-text p {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 4px;
  position: relative;
  z-index: 1;
}

.nav-label {
  margin-top: 14px;
  margin-bottom: 3px;
  padding: 0 8px;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  font-weight: 700;
}

.sidebar-link {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 12px;
  padding: 11px 12px;
  text-align: left;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: all 0.24s ease;
}

.sidebar-link:hover {
  color: var(--text-primary);
  border-color: var(--border-main);
  background: var(--bg-hover);
  transform: translateX(4px);
  box-shadow: var(--glow-cyan);
}

.sidebar-link.active {
  color: #041521;
  background: linear-gradient(135deg, var(--accent-cyan), #6bebff);
  box-shadow: 0 10px 24px rgba(0, 214, 255, 0.45);
}

.mobile-sidebar-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 12px;
  z-index: 80;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-main);
  background: var(--bg-panel-strong);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.mobile-sidebar-toggle span {
  width: 18px;
  height: 2px;
  background: var(--accent-cyan);
  border-radius: 8px;
}

.sidebar-overlay {
  display: none;
}

.main-pane {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding: 18px 22px 24px;
}

.site-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.title-section {
  flex: 1;
}

.glitch-title {
  font-family: 'Orbitron', monospace;
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: 4px;
  color: var(--text-primary);
  text-shadow: 0 0 16px rgba(0, 214, 255, 0.42), 0 0 30px rgba(43, 123, 255, 0.25);
}

.subtitle {
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: clamp(0.95rem, 2.2vw, 1.2rem);
  letter-spacing: 1px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quick-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quick-link {
  text-decoration: none;
  border: 1px solid var(--border-main);
  border-radius: 10px;
  padding: 8px 12px;
  color: var(--text-secondary);
  background: var(--bg-panel);
  transition: all 0.2s ease;
  font-weight: 600;
}

.quick-link:hover {
  color: var(--text-primary);
  border-color: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
}

.menu-container {
  position: relative;
}

.menu-btn {
  border: 1px solid var(--border-main);
  border-radius: 12px;
  background: var(--bg-panel-strong);
  color: var(--text-primary);
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.menu-icon {
  width: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-icon span {
  height: 2px;
  background: var(--accent-cyan);
}

.menu-text {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 240px;
  background: var(--bg-panel-strong);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  padding: 8px;
  box-shadow: var(--shadow-main);
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 50;
}

.dropdown-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.menu-item {
  display: block;
  text-decoration: none;
  color: var(--text-secondary);
  padding: 10px 12px;
  border-radius: 10px;
  transition: all 0.2s ease;
  font-weight: 600;
}

.menu-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.main-content {
  display: block;
}

.content-section {
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(18, 28, 48, 0.76), rgba(14, 20, 36, 0.9));
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-main);
  min-height: calc(100vh - 170px);
  padding: clamp(18px, 2vw, 30px);
  transition: all 0.25s ease;
}

.welcome-message {
  text-align: center;
  padding: 14px 4px;
}

.welcome-message h2 {
  font-size: clamp(1.5rem, 3.2vw, 2.2rem);
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.welcome-message p {
  color: var(--text-secondary);
  font-size: 1rem;
}

.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 18px auto;
  width: min(760px, 100%);
}

.stats-bar span {
  border: 1px solid var(--border-main);
  border-radius: 12px;
  background: rgba(0, 214, 255, 0.08);
  color: var(--text-primary);
  padding: 12px;
  font-weight: 700;
  display: flex;
  justify-content: center;
  align-items: center;
}

.sync-note {
  color: var(--text-muted);
  font-size: 0.94rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 16px;
  border: 1px solid var(--border-soft);
  background: rgba(0, 214, 255, 0.07);
  border-radius: 10px;
  padding: 10px 12px;
}

.breadcrumb-item {
  color: var(--text-secondary);
}

.breadcrumb-item.clickable {
  color: var(--accent-cyan);
  cursor: pointer;
  font-weight: 700;
}

.breadcrumb-item.current {
  color: #6bebff;
  font-weight: 700;
}

.breadcrumb-sep {
  color: var(--text-muted);
}

.folder-grid {
  margin-top: 16px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.folder-item,
.file-item {
  border: 1px solid var(--border-main);
  background: var(--bg-panel);
  border-radius: 14px;
  padding: 16px;
  transition: all 0.2s ease;
}

.folder-item {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.folder-item:hover,
.file-item:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-2px);
  box-shadow: var(--glow-cyan);
}

.folder-icon-large,
.file-icon {
  font-size: 1.9rem;
}

.item-info h4,
.file-item h4 {
  font-size: 1rem;
  margin-bottom: 4px;
  line-height: 1.25;
}

.item-info p,
.file-item p,
.path-hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  word-break: break-word;
}

.file-item-header {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.file-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.view-btn,
.download-btn,
.modal-btn {
  border: 1px solid var(--border-main);
  background: rgba(0, 214, 255, 0.1);
  color: var(--text-primary);
  border-radius: 10px;
  padding: 9px 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-btn:hover,
.download-btn:hover,
.modal-btn:hover {
  border-color: var(--accent-cyan);
  background: rgba(0, 214, 255, 0.2);
}

.empty-folder,
.error-message {
  border: 1px solid var(--border-main);
  background: var(--bg-panel);
  border-radius: 14px;
  text-align: center;
  padding: 28px 18px;
  margin-top: 18px;
}

.empty-icon,
.error-icon {
  font-size: 2.1rem;
  margin-bottom: 8px;
}

.modal {
  border: none;
  padding: 0;
  width: min(1100px, 94vw);
  background: transparent;
}

.modal::backdrop {
  background: rgba(5, 10, 19, 0.78);
  backdrop-filter: blur(4px);
}

.modal-content {
  border: 1px solid var(--border-main);
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-panel-strong);
  box-shadow: var(--shadow-main);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--border-soft);
}

.modal-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-body {
  height: min(78vh, 860px);
}

#pdfViewer {
  width: 100%;
  height: 100%;
  border: 0;
  background: #0a0f1b;
}

@media (max-width: 1120px) {
  .site-header {
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions {
    justify-content: space-between;
    flex-wrap: wrap;
  }
}

@media (max-width: 960px) {
  .mobile-sidebar-toggle {
    display: inline-flex;
  }

  .sidebar {
    transform: translateX(-103%);
    transition: transform 0.25s ease;
    width: min(84vw, 290px);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.visible {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(4, 10, 20, 0.6);
    z-index: 25;
  }

  .main-pane {
    margin-left: 0;
    padding: 72px 14px 16px;
  }

  .content-section {
    min-height: auto;
  }
}

@media (max-width: 620px) {
  .quick-links {
    width: 100%;
    justify-content: space-between;
    gap: 6px;
  }

  .quick-link {
    font-size: 0.85rem;
    padding: 8px 10px;
  }

  .file-actions {
    flex-direction: column;
  }

  .view-btn,
  .download-btn {
    width: 100%;
  }
}
