:root {
  --bg-dark: #0b0f19;
  --bg-card: rgba(19, 26, 42, 0.75);
  --bg-card-hover: rgba(27, 36, 58, 0.85);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-color-glow: rgba(0, 242, 254, 0.3);
  
  --primary-glow: #00f2fe;
  --primary-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --secondary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --accent-yt: #ff2a5f;
  --accent-yt-gradient: linear-gradient(135deg, #ff0844 0%, #ffb199 100%);
  --admin-gradient: linear-gradient(135deg, #f59e0b 0%, #ec4899 100%);
  --success: #10b981;
  --warning: #f59e0b;

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --font-main: 'Plus Jakarta Sans', sans-serif;
  --font-heading: 'Outfit', sans-serif;

  --shadow-main: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(0, 242, 254, 0.25);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Background Ambient Glowing Blobs */
.glow-bg-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
}

.blob-1 {
  width: 500px;
  height: 500px;
  background: #4facfe;
  top: -100px;
  left: -100px;
}

.blob-2 {
  width: 600px;
  height: 600px;
  background: #764ba2;
  bottom: -150px;
  right: -150px;
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-icon {
  width: 52px;
  height: 52px;
  background: var(--primary-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #000;
  box-shadow: var(--shadow-glow);
}

.brand-text h1 {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-text h1 span {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.brand-text code {
  color: var(--primary-glow);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

/* User Pill & Rank Badges */
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.user-pill.badge-admin {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.user-pill.badge-user {
  background: rgba(0, 242, 254, 0.15);
  border: 1px solid rgba(0, 242, 254, 0.4);
  color: var(--primary-glow);
}

.user-pill.badge-guest {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.3rem;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #000;
  box-shadow: 0 4px 15px rgba(0, 242, 254, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 242, 254, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-vrcdn {
  background: linear-gradient(135deg, #00f2fe 0%, #3be2e2 100%);
  color: #05141c;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(59, 226, 226, 0.25);
  border: none;
}

.btn-vrcdn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(59, 226, 226, 0.45);
}

.vrcdn-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(59, 226, 226, 0.15);
  color: #3be2e2;
  border: 1px solid rgba(59, 226, 226, 0.3);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Cards & Layout */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-main);
  margin-bottom: 2rem;
}

.downloader-card .card-header {
  margin-bottom: 1.5rem;
}

.downloader-card .card-header h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.downloader-card .card-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.icon-yt {
  color: #ff0033;
}

/* Guest Banner */
.guest-banner {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.guest-banner-icon {
  width: 44px;
  height: 44px;
  background: rgba(245, 158, 11, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fbbf24;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.guest-banner-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.guest-banner-text strong {
  color: #fbbf24;
}

.guest-banner-text a {
  color: var(--primary-glow);
  text-decoration: underline;
  cursor: pointer;
}

/* Download Form */
.download-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.input-group {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.4rem;
  transition: all 0.25s ease;
}

.input-group:focus-within {
  border-color: var(--primary-glow);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.2);
}

.input-icon {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}

.input-group input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-family: var(--font-main);
  font-size: 1rem;
  outline: none;
  padding: 0.6rem 0.5rem;
}

.input-group input::placeholder {
  color: var(--text-dim);
}

.form-row-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.folder-select-container {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.section-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-select {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.9rem;
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

.form-select option {
  background: #111827;
  color: #fff;
}

.quality-selector-group {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.quality-options {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.quality-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.quality-chip input {
  display: none;
}

.quality-chip.active {
  background: rgba(0, 242, 254, 0.12);
  border-color: var(--primary-glow);
  color: var(--primary-glow);
  box-shadow: 0 0 12px rgba(0, 242, 254, 0.15);
}

/* Progress Visualizer */
.progress-box {
  margin-top: 1.5rem;
  padding: 1.4rem;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.progress-title-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.step-badge {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  background: rgba(0, 242, 254, 0.15);
  color: var(--primary-glow);
  border-radius: var(--radius-sm);
}

.percent-text {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-glow);
}

.progress-bar-container {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary-gradient);
  box-shadow: 0 0 10px rgba(0, 242, 254, 0.5);
  transition: width 0.3s ease;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.step-item {
  font-size: 0.8rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.step-item.active {
  color: var(--primary-glow);
  font-weight: 600;
}

.step-item.done {
  color: var(--success);
}

/* Explorer Section & Toolbar */
.dashboard-section {
  margin-top: 0.5rem;
}

.explorer-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border-color);
}

.breadcrumbs-container {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.breadcrumb-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.breadcrumb-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.breadcrumb-chip.active {
  background: rgba(0, 242, 254, 0.12);
  border-color: var(--primary-glow);
  color: var(--primary-glow);
  font-weight: 600;
}

.breadcrumb-separator {
  color: var(--text-dim);
  font-size: 0.75rem;
}

.explorer-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.count-badge {
  padding: 0.4rem 0.9rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* Media & Folders Grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* Folder Card */
.folder-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.folder-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-glow);
  background: var(--bg-card-hover);
  box-shadow: 0 8px 24px rgba(0, 242, 254, 0.15);
}

.folder-icon-box {
  width: 52px;
  height: 52px;
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--primary-glow);
  flex-shrink: 0;
}

.folder-details {
  flex: 1;
  overflow: hidden;
}

.folder-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.folder-card-actions {
  display: flex;
  gap: 0.3rem;
}

/* Media Card */
.media-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.media-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-color-glow);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

.media-thumb-box {
  position: relative;
  width: 100%;
  height: 180px;
  background: #000;
  overflow: hidden;
}

.media-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.media-card:hover .media-thumb-box img {
  transform: scale(1.04);
}

.play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  cursor: pointer;
}

.media-thumb-box:hover .play-overlay {
  opacity: 1;
}

.play-btn-circle {
  width: 54px;
  height: 54px;
  background: var(--primary-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-size: 1.4rem;
  box-shadow: var(--shadow-glow);
}

.media-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 0.25rem 0.6rem;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.quality-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.badge-4k {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.35), rgba(168, 85, 247, 0.35)) !important;
  color: #f472b6 !important;
  border: 1px solid rgba(236, 72, 153, 0.55);
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.3);
}

.badge-1440p {
  background: rgba(168, 85, 247, 0.3) !important;
  color: #c084fc !important;
  border: 1px solid rgba(168, 85, 247, 0.5);
}

.badge-1080p {
  background: rgba(0, 242, 254, 0.25) !important;
  color: #00f2fe !important;
  border: 1px solid rgba(0, 242, 254, 0.45);
  box-shadow: 0 0 8px rgba(0, 242, 254, 0.2);
}

.badge-720p {
  background: rgba(34, 197, 94, 0.25) !important;
  color: #4ade80 !important;
  border: 1px solid rgba(34, 197, 94, 0.45);
}

.badge-audio {
  background: rgba(245, 158, 11, 0.25) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.badge-hd {
  background: rgba(59, 130, 246, 0.25) !important;
  color: #60a5fa !important;
  border: 1px solid rgba(59, 130, 246, 0.45);
}

.badge-volume {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.media-body {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.media-title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.6rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.media-meta-row {
  display: flex;
  gap: 0.8rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
  align-items: center;
}

.owner-badge {
  color: var(--primary-glow);
}

.url-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.url-box:hover {
  background: rgba(0, 242, 254, 0.08);
  border-color: rgba(0, 242, 254, 0.4);
  transform: translateY(-1px);
}

.url-box:active {
  transform: scale(0.98);
}

.url-box.copied {
  background: rgba(34, 197, 94, 0.15) !important;
  border-color: rgba(34, 197, 94, 0.5) !important;
}

.url-text {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--primary-glow);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.copy-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.3rem;
  transition: all 0.2s ease;
}

.copy-icon-btn:hover {
  color: #fff;
  transform: scale(1.15);
}

.media-card-footer {
  display: flex;
  gap: 0.4rem;
  padding: 0.8rem 1.2rem;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.15);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  grid-column: 1 / -1;
}

.empty-icon {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: var(--text-dim);
  margin: 0 auto 1.2rem;
}

.empty-state h3 {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}

.modal-card {
  background: #111827;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 540px;
  box-shadow: var(--shadow-main);
  animation: fadeIn 0.25s ease-out;
  overflow: hidden;
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  margin: auto;
}

.modal-lg {
  max-width: 880px;
}

.modal-xl {
  max-width: 1140px;
  width: 95%;
}

.modal-header {
  padding: 1.2rem 1.8rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.modal-header h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.modal-close:hover {
  color: #fff;
}

.settings-form {
  padding: 1.6rem 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
  overflow-y: auto;
  max-height: calc(100vh - 8rem);
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 242, 254, 0.3) rgba(0, 0, 0, 0.2);
}

.settings-form::-webkit-scrollbar,
.users-modal-body::-webkit-scrollbar {
  width: 6px;
}

.settings-form::-webkit-scrollbar-track,
.users-modal-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.settings-form::-webkit-scrollbar-thumb,
.users-modal-body::-webkit-scrollbar-thumb {
  background: rgba(0, 242, 254, 0.3);
  border-radius: 3px;
}

.settings-form::-webkit-scrollbar-thumb:hover,
.users-modal-body::-webkit-scrollbar-thumb:hover {
  background: var(--primary-glow);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input, .form-group textarea {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: #fff;
  font-family: var(--font-main);
  font-size: 0.95rem;
  outline: none;
}

.form-group textarea {
  font-family: monospace;
  font-size: 0.8rem;
  resize: vertical;
}

.form-group input:focus, .form-group textarea:focus {
  border-color: var(--primary-glow);
}

.form-group small {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.modal-footer {
  padding: 1.2rem 1.8rem;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  flex-shrink: 0;
}

/* User Management Modal Components */
.users-modal-body {
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 242, 254, 0.3) rgba(0, 0, 0, 0.2);
}

.add-user-card {
  padding: 1.2rem;
  border-radius: var(--radius-md);
  margin-bottom: 0;
}

.add-user-card h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.add-user-card {
  margin-bottom: 1.5rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
}

.create-user-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.1fr 1.1fr auto;
  gap: 0.85rem;
  align-items: flex-end;
}

@media (max-width: 900px) {
  .create-user-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 550px) {
  .create-user-grid {
    grid-template-columns: 1fr;
  }
}

.users-table-container h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.users-table th, .users-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.users-table th {
  color: var(--text-muted);
  font-weight: 600;
  background: rgba(0, 0, 0, 0.25);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.role-tag {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1;
}

.role-tag.admin {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

.role-tag.moderator {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
}

.role-tag.user {
  background: rgba(0, 242, 254, 0.2);
  color: var(--primary-glow);
}

.role-tag.guest {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

.user-perms-row {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.perm-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.perm-pill.perm-upload {
  background: rgba(0, 242, 254, 0.15);
  color: #00f2fe;
  border: 1px solid rgba(0, 242, 254, 0.3);
}

.perm-pill.perm-edit {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.3);
}

.perm-pill.perm-delete {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.perm-pill.perm-readonly {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.user-disk-pill {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(0, 242, 254, 0.2);
  width: 260px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
  height: 50px;
}

.user-disk-pill .disk-pill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  width: 100%;
}

.user-disk-pill .disk-pill-used {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  white-space: nowrap;
}

.user-disk-pill .disk-pill-limit {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.user-disk-pill .disk-pill-files {
  font-size: 0.72rem;
  color: #3be2e2;
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid rgba(0, 242, 254, 0.25);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
}

.user-disk-pill .disk-pill-progress {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
}

.user-disk-pill .disk-pill-bar {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #00f2fe, #4facfe);
  transition: width 0.3s ease;
}

.user-disk-pill .disk-pill-bar.bar-unlimited {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.6), rgba(251, 191, 36, 0.9));
}

.user-disk-pill .disk-pill-bar.bar-warning {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.user-disk-pill .disk-pill-bar.bar-danger {
  background: linear-gradient(90deg, #ef4444, #f87171);
}


.user-disk-usage-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.25rem;
}

.disk-icon-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(0, 242, 254, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--primary-glow);
  flex-shrink: 0;
}

.disk-usage-info {
  flex: 1;
}

.disk-usage-val {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.disk-usage-info small {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Cover Image Preview & Upload */
.cover-upload-container {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.cover-preview-box {
  position: relative;
  width: 100%;
  height: 170px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #080c14;
  border: 1px solid var(--border-color);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.cover-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cover-preview-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  opacity: 0.85;
  transition: all 0.2s ease;
  backdrop-filter: blur(2px);
}

.cover-preview-box:hover .cover-preview-overlay {
  opacity: 1;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.cover-url-input-box {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.25rem;
  animation: fadeIn 0.2s ease;
}

/* Player Modal */
.player-container {
  padding: 1rem;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 350px;
}

.player-container video, .player-container audio {
  width: 100%;
  max-height: 480px;
  border-radius: var(--radius-md);
}

.hidden {
  display: none !important;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

/* File Settings & Permissions Modal Styles */
.modal-divider {
  border: 0;
  height: 1px;
  background: var(--border-color);
  margin: 1.25rem 0;
}

.permission-toggle-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.toggle-info {
  flex: 1;
  padding-right: 1rem;
}

.toggle-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toggle-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Switch Toggle UI */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
}

input:checked + .slider {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* Roles / Groups Checkbox List */
.roles-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.custom-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.custom-checkbox-label:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.custom-checkbox-label input {
  display: none;
}

.checkbox-custom {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.custom-checkbox-label input:checked + .checkbox-custom {
  background: var(--primary-glow);
  border-color: var(--primary-glow);
  box-shadow: 0 0 8px rgba(0, 242, 254, 0.4);
}

.custom-checkbox-label input:checked + .checkbox-custom:after {
  content: "✓";
  color: #000;
  font-size: 0.75rem;
  font-weight: 900;
}

.checkbox-text {
  font-size: 0.88rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* User Search & Multi-Select Autocomplete */
.user-search-wrapper {
  position: relative;
  margin-top: 0.4rem;
}

.search-input-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-box .search-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.search-input-box input {
  padding-left: 2.4rem !important;
}

.user-suggestions-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: rgba(18, 22, 36, 0.98);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  max-height: 160px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
}

.user-suggestion-item {
  padding: 0.6rem 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.15s ease;
}

.user-suggestion-item:hover {
  background: rgba(0, 242, 254, 0.12);
  color: var(--primary-glow);
}

.allowed-users-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
  min-height: 28px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #c084fc;
  font-size: 0.8rem;
  font-weight: 600;
}

.user-chip-remove {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
}

.user-chip-remove:hover {
  color: #ef4444;
}

/* Visibility Pill on Media Cards */
.visibility-pill {
  font-size: 0.68rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.visibility-pill.hidden-pill {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.visibility-pill.restricted-pill {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.visibility-pill.public-pill {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #4ade80;
}

/* Custom Confirm Dialog Modal */
.confirm-modal-card {
  max-width: 440px !important;
  text-align: center;
  padding: 2.2rem 2rem 1.8rem;
  background: rgba(18, 22, 36, 0.95) !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 35px rgba(239, 68, 68, 0.15) !important;
  backdrop-filter: blur(20px);
}

.confirm-icon-box {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #ef4444;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
  animation: pulseWarning 2s infinite ease-in-out;
}

@keyframes pulseWarning {
  0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(239, 68, 68, 0.2); }
  50% { transform: scale(1.05); box-shadow: 0 0 30px rgba(239, 68, 68, 0.4); }
}

.confirm-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.6rem;
  font-family: var(--font-heading);
}

.confirm-message {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.confirm-item-badge {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 0.85rem;
  color: #60a5fa;
  margin-bottom: 1.75rem;
  word-break: break-all;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: center;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.confirm-actions .btn {
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

/* Toast Notifications Container */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
  max-width: 420px;
  width: calc(100% - 3rem);
}

.toast-item {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  background: rgba(18, 22, 36, 0.96);
  border: 1px solid var(--border-color);
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
  color: #fff;
  font-size: 0.9rem;
  animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: all 0.3s ease;
}

.toast-item.toast-success {
  border-color: rgba(34, 197, 94, 0.4);
  box-shadow: 0 10px 30px rgba(34, 197, 94, 0.15);
}

.toast-item.toast-success i.toast-main-icon {
  color: #22c55e;
}

.toast-item.toast-error {
  border-color: rgba(239, 68, 68, 0.4);
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.15);
}

.toast-item.toast-error i.toast-main-icon {
  color: #ef4444;
}

.toast-item.toast-info {
  border-color: rgba(0, 242, 254, 0.4);
  box-shadow: 0 10px 30px rgba(0, 242, 254, 0.15);
}

.toast-item.toast-info i.toast-main-icon {
  color: #00f2fe;
}

.toast-content {
  flex: 1;
  line-height: 1.45;
}

.toast-close-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.2rem;
  font-size: 0.85rem;
  transition: color 0.2s ease;
}

.toast-close-btn:hover {
  color: #fff;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(100px) scale(0.9);
  }
}

/* Footer */
.app-footer {
  margin-top: auto;
  padding-top: 3rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Maintenance Admin Banner */
.maintenance-admin-banner {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.22), rgba(180, 83, 9, 0.32));
  border-bottom: 1px solid rgba(245, 158, 11, 0.45);
  color: #fef3c7;
  padding: 0.65rem 1.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
  z-index: 90;
  position: relative;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.15);
}

.maintenance-admin-banner .banner-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-outline-warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fbbf24;
  font-weight: 700;
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.btn-outline-warning:hover {
  background: #f59e0b;
  color: #111827;
  border-color: #f59e0b;
  transform: translateY(-1px);
}

/* Maintenance Fullscreen Overlay */
.maintenance-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 35%, rgba(17, 24, 39, 0.96), rgba(3, 7, 18, 0.99));
  backdrop-filter: blur(16px);
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.3s ease-out;
}

.maintenance-card {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2.2rem;
  max-width: 500px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.7), 0 0 35px rgba(245, 158, 11, 0.18);
}

.maintenance-icon-glow {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: #fbbf24;
  margin-bottom: 0.25rem;
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.25);
}

.maintenance-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.maintenance-card h2 {
  font-family: var(--font-heading);
  font-size: 1.65rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
}

.maintenance-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0;
}

.maintenance-notice-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
  font-size: 0.85rem;
  color: var(--text-main);
  text-align: left;
  width: 100%;
}

