/* ─── ZenVort: COMPLETE METALLIC DASHBOARD THEME ─── */

:root {
  --bg: #f3f6f9;
  --surface: rgba(255, 255, 255, 0.85);
  --border: rgba(210, 214, 220, 0.8);
  --accent: #a5bbf5;      /* Subtly darker for better contrast */
  --accent-light: #eef3ff;
  --accent2: #f2c779;     /* Metallic gold touch */
  --muted: #64748b;
  --text: #0f172a;
  --danger: #ef4444;
  --success: #10b981;
  
  --mono: 'Space Mono', monospace;
  --sans: 'DM Sans', sans-serif;

  /* Crisp, locked-in sizes */
  --container-max: 720px;
  --card-padding: 36px;
  --base-font: 15px;
  --small-font: 13px;
}

/* ─── RESET & BASE ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--base-font);
  overflow: hidden; /* Locks the body for the Dashboard layout */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Global Fix for Media Elements */
img, video { max-width: 100%; height: auto; display: block; }

/* ─── UTILITIES & GLASS EFFECT ─── */
.glass-effect {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 14px;
}

.glass-effect-sidebar {
  background: rgba(255, 255, 255, 0.45);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Hover glows */
.glow-on-hover:not(:disabled):hover {
  box-shadow: 0 8px 24px rgba(165, 187, 245, 0.3), inset 0 1px 0 rgba(255,255,255,0.8);
  transform: translateY(-1px);
}
.glow-on-hover-alt:hover {
  box-shadow: 0 8px 24px rgba(242, 199, 121, 0.2), inset 0 1px 0 rgba(255,255,255,0.8);
  transform: translateY(-1px);
}


/* ─── DASHBOARD LAYOUT ─── */
.dashboard-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
}

/* ─── SIDEBAR ─── */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 24px;
  z-index: 1000;
  overflow-y: auto; /* 🛠️ THE FIX: Allows the sidebar to scroll */
  overflow-x: hidden;
}

/* Optional: Make the sidebar scrollbar slim and metallic so it matches the ZenVort theme */
.sidebar::-webkit-scrollbar {
  width: 4px;
}
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.2); 
  border-radius: 4px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.5); 
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

.sidebar-header .logo-mark {
  width: 38px; height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #f0f3f7);
  border: 1px solid rgba(210,214,220,0.9);
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  color: var(--accent2);
}

.sidebar-header h1 {
  font-family: var(--mono); 
  font-size: 1.2rem; 
  color: var(--text); 
  font-weight: 700;
}
.sidebar-header h1 span { color: var(--accent2); }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-btn {
  background: transparent;
  border: none;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  text-align: left;
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.6);
  color: var(--text);
}

.nav-btn.active {
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  border: 1px solid var(--border);
}

.sidebar-footer {
  margin-top: auto;
}

.badge {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text);
  border: 1px solid var(--border);
  background: #ffffff;
  padding: 6px 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 6px;
  display: inline-block;
}


/* ─── MAIN CONTENT AREA ─── */
.main-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 40px;
  position: relative;
}

.page-view {
  display: none;
  max-width: var(--container-max);
  margin: 0 auto;
  animation: fadeUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.page-view.active { display: block; }

.page-header { margin-bottom: 32px; }
.page-header h2 {
  font-family: var(--mono);
  font-size: 1.8rem;
  color: var(--text);
  margin-bottom: 6px;
}
.page-header p {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}


/* ─── PAGE 1: HOME DASHBOARD CARDS ─── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.dash-card {
  padding: 28px;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  text-align: left;
}

.dash-card.disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.dash-icon {
  font-size: 1.5rem;
  color: var(--accent2);
  margin-bottom: 16px;
  background: #ffffff;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.dash-card h3 {
  font-family: var(--mono);
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 8px;
}

.dash-card p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.dash-arrow {
  position: absolute;
  bottom: 28px;
  right: 28px;
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent2);
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
}

.dash-card:not(.disabled):hover .dash-arrow {
  opacity: 1;
  transform: translateX(0);
}


/* ─── PAGE 2: VIDEO CONVERTER TOOL ─── */
.card {
  padding: var(--card-padding);
  position: relative;
  width: 100%;
  margin-bottom: 24px;
}

/* Drop zone */
.drop-zone {
  border: 2px dashed rgba(200, 205, 212, 0.8);
  padding: 48px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .2s ease;
  position: relative;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.4);
}
.drop-zone:hover, .drop-zone.dragging {
  border-color: var(--accent);
  background: var(--accent-light);
}
.drop-zone input[type="file"] { 
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; 
}
.drop-icon {
  color: var(--accent);
  margin: 0 auto 16px;
  transition: transform .2s ease;
  display: flex;
  justify-content: center;
}
.drop-zone:hover .drop-icon { transform: translateY(-4px); }
.drop-zone h2 {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.drop-zone p { font-size: 0.85rem; color: var(--muted); }

.file-chip {
  display: none;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 10px 16px;
  font-family: var(--mono);
  font-size: var(--small-font);
  color: var(--text);
  border-radius: 8px;
  text-align: left;
}
.file-chip.show { display: flex; }
.file-chip .size-tag { margin-left: auto; color: var(--muted); font-weight: 700; }

/* Options row */
.options-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 28px;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.field select {
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: var(--base-font);
  padding: 12px 16px;
  appearance: none;
  outline: none;
  transition: all .2s;
  width: 100%;
  cursor: pointer;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.select-wrap { position: relative; }
.select-wrap::after {
  content: '▾';
  position: absolute;
  right: 16px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  font-weight: bold;
}

/* Format chips */
.format-hints { 
  display: flex; 
  gap: 10px; 
  flex-wrap: wrap; 
  margin-top: 16px; 
}
.fmt-chip {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 6px 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: 6px;
  background: #ffffff;
  transition: all .2s;
}
.fmt-chip.active {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-light);
}

/* Warning banner */
.warn-banner {
  display: none;
  margin-top: 20px;
  padding: 14px 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  font-size: 0.8rem;
  color: var(--danger);
  font-family: var(--mono);
  align-items: center;
  border-radius: 8px;
}
.warn-banner.show { display: flex; }

/* Convert button */
.convert-btn {
  margin-top: 32px;
  width: 100%;
  background: #1e293b; 
  color: #ffffff;
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: none;
  padding: 18px;
  cursor: pointer;
  transition: all .2s;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}
.convert-btn:disabled { opacity: .5; cursor: not-allowed; background: var(--muted); box-shadow: none; }
.convert-btn:not(:disabled):active { transform: scale(.99); }
.convert-btn .btn-shimmer {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.15) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: shimmer 2.5s infinite;
}
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(200%); } }

/* Progress */
.progress-wrap { margin-top: 24px; display: none; }
.progress-wrap.show { display: block; }
.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.progress-label .pct { color: var(--text); }
progress {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 8px; border: none;
  background: #e2e8f0;
  display: block; border-radius: 4px; overflow: hidden;
}
progress::-webkit-progress-bar { background: transparent; }
progress::-webkit-progress-value {
  background: var(--text); 
  transition: width .2s ease; border-radius: 4px;
}

/* Status */
.status-line {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: var(--small-font);
  color: var(--muted);
  min-height: 1.4em;
}
.status-line.active { color: var(--text); font-weight: bold; }
.status-line.done { color: var(--success); font-weight: bold; }
.status-line.error { color: var(--danger); font-weight: bold; }

/* Output card */
.output-card {
  padding: var(--card-padding);
  display: none;
  width: 100%;
  margin-bottom: 24px;
}
.output-card.show { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.output-card h3 {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 20px;
  font-weight: 700;
}
#output-video, #output-image {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  background: #000000;
  display: none;
  border-radius: 8px;
}
.download-btn {
  display: block;
  margin-top: 24px;
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 16px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: all .2s;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.download-btn:hover { border-color: var(--accent2); background: var(--accent-light); }

/* Footer */
.footer-note {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
  margin-top: 10px;
}

/* ─── FLOATING DONATION BUTTON ─── */
.floating-donate-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: linear-gradient(145deg, #ffcc00, #ffaa00);
  color: #111;
  padding: 12px 22px;
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(255, 204, 0, 0.3);
  z-index: 9999;
  transition: all 0.3s ease;
}
.floating-donate-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 6px 20px rgba(255, 204, 0, 0.5);
  color: #000;
}
.floating-donate-btn .icon { font-size: 1.3rem; }

/* Shrink to just a circular icon on mobile screens */
@media (max-width: 768px) {
  .floating-donate-btn {
    bottom: 20px;
    right: 20px;
    padding: 14px;
    border-radius: 50%;
  }
  .floating-donate-btn .text { display: none; }
  .floating-donate-btn .icon { font-size: 1.5rem; margin: 0; }
}

/* ─── RESPONSIVE DESIGN & SLIDE-OUT MENU (MOBILE) ─── */

/* Hide mobile-specific header and overlay on Desktop */
@media (min-width: 801px) {
  .mobile-header, .sidebar-overlay {
    display: none;
  }
}

@media (max-width: 800px) {
  /* Release body constraints for mobile scrolling */
  .dashboard-layout {
    flex-direction: column;
    overflow-y: auto;
  }
  
  body {
    overflow-y: auto;
  }

  /* Sleek Metallic Mobile Header */
  .mobile-header {
    display: flex;
    align-items: center;
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 998;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
  }

  .mobile-menu-btn {
    background: transparent;
    border: none;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0;
    margin-right: 15px;
  }

  .mobile-title {
    font-family: var(--mono);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
  }

  /* Slide-out Sidebar - Metallic Theme */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--border);
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.1);
    /* Ensure internal items stack vertically */
    display: flex;
    flex-direction: column;
    padding: 24px;
  }

  /* When JS adds .active class, the sidebar slides in */
  .sidebar.active {
    transform: translateX(0);
  }

  /* Frosted Glass Backdrop Overlay */
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4); /* Muted slate overlay */
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }

  .sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
  }

  /* Adjust main content padding for smaller screens */
  .main-content {
    padding: 24px 16px;
    overflow-y: visible;
  }

  .options-row { 
    grid-template-columns: 1fr; 
    gap: 16px; 
  }
  
  .card, .output-card { 
    padding: 24px; 
  }
}