/* ==========================================================
   CLOUDKU - CORE DESIGN SYSTEM & STYLES
   Modern Glassmorphism, Responsive Dark UI & Vibrant Accents
   ========================================================== */

:root {
  /* Color Palette */
  --bg-main: #0a0d14;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(28, 36, 56, 0.85);
  --bg-card-solid: #121826;
  --bg-input: rgba(13, 17, 26, 0.8);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-glow: rgba(56, 189, 248, 0.25);
  
  /* Text Colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  /* Brand & Accents */
  --primary: #38bdf8;         /* Cyan Sky */
  --primary-glow: rgba(56, 189, 248, 0.4);
  --secondary: #818cf8;       /* Indigo */
  --accent-purple: #c084fc;   /* Violet / Video */
  --accent-emerald: #34d399;  /* Green / Photo */
  --accent-amber: #fbbf24;    /* Gold / Audio */
  --accent-cyan: #22d3ee;     /* Doc */
  --accent-rose: #fb7185;     /* Archive */
  --accent-danger: #f43f5e;   /* Live / Red */
  
  /* Layout Dimensions */
  --sidebar-width: 280px;
  --topbar-height: 70px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  /* Transitions & Shadows */
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.15);
}

/* Reset & Base Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(56, 189, 248, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(192, 132, 252, 0.06) 0%, transparent 45%);
  background-attachment: fixed;
}

/* App Layout Grid */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ================= SIDEBAR ================= */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-card-solid);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: var(--transition);
}

.sidebar-header {
  padding: 24px 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #fff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.35);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-upload {
  padding: 8px 20px 16px;
}

.upload-btn-glow {
  box-shadow: 0 4px 18px rgba(56, 189, 248, 0.3);
  position: relative;
  overflow: hidden;
}

.upload-btn-glow::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(60deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: rotate(30deg);
  transition: var(--transition);
}

.upload-btn-glow:hover::after {
  left: 100%;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px;
}

.nav-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 1px;
  padding: 16px 12px 6px;
}

.nav-list {
  list-style: none;
}

.nav-item {
  margin-bottom: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: var(--transition);
  position: relative;
}

.nav-link i {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.nav-link:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-item.active .nav-link {
  color: #fff;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.2);
  font-weight: 600;
}

.nav-item.active .nav-link::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 15%;
  height: 70%;
  width: 4px;
  background: var(--primary);
  border-radius: 0 4px 4px 0;
}

.badge {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.nav-item.active .badge {
  background: var(--primary);
  color: #000;
  font-weight: 700;
}

.live-pulse-link {
  background: rgba(244, 63, 94, 0.08);
  border: 1px solid rgba(244, 63, 94, 0.2);
}

.live-pulse-link:hover {
  background: rgba(244, 63, 94, 0.15) !important;
}

.live-dot-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--accent-danger);
  color: #fff;
  letter-spacing: 0.5px;
  animation: pulse-glow 1.5s infinite;
}

/* Sidebar Footer Storage Info */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
}

.storage-card {
  background: rgba(13, 17, 26, 0.9);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.storage-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.tag-unlimited {
  margin-left: auto;
  font-size: 10px;
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
  color: #000;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.storage-progress {
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 6px;
}

.infinite-glow {
  background: linear-gradient(90deg, #38bdf8, #818cf8, #c084fc, #38bdf8);
  background-size: 200% auto;
  animation: shimmer 3s linear infinite;
}

.storage-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}

/* ================= MAIN CONTENT & TOPBAR ================= */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-height);
  background: rgba(10, 13, 20, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  max-width: 500px;
}

.mobile-menu-btn {
  display: none;
}

.search-box {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.search-box i {
  position: absolute;
  left: 14px;
  color: var(--text-dim);
  font-size: 14px;
}

.search-box input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 10px 38px 10px 40px;
  font-size: 14px;
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.clear-search {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.connection-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.connection-pill:hover {
  background: rgba(255, 255, 255, 0.08);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.online {
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

.status-dot.offline {
  background: var(--accent-amber);
}

.view-switch {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2px;
}

.view-switch .btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--text-muted);
}

.view-switch .btn-icon.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.live-hub-topbtn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-danger);
  animation: pulse-glow 1.5s infinite;
}

/* ================= PAGE CONTAINER & STATS ================= */
.content-container {
  padding: 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-color-glow);
  box-shadow: var(--shadow-glow);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

/* ================= DROPZONE UPLOAD ================= */
.upload-dropzone {
  background: rgba(18, 24, 38, 0.45);
  border: 2px dashed rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
}

.upload-dropzone.dragover {
  background: rgba(56, 189, 248, 0.1);
  border-color: var(--primary);
  transform: scale(1.01);
}

.dropzone-icon {
  font-size: 40px;
  color: var(--primary);
  margin-bottom: 12px;
  animation: float 3s ease-in-out infinite;
}

.dropzone-text h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.dropzone-text p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Upload Progress Bar */
.upload-progress-container {
  max-width: 500px;
  margin: 0 auto;
  text-align: left;
}

.upload-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

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

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  border-radius: 10px;
  transition: width 0.2s ease;
}

.upload-progress-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ================= EXPLORER TOOLBAR ================= */
.explorer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
}

.toolbar-title-group {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.section-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.file-counter {
  font-size: 13px;
  color: var(--text-muted);
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.select-dropdown select {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

/* ================= FILE GRID & CARDS ================= */
.files-wrapper {
  flex: 1;
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.file-grid.list-view {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
}

.file-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-color-glow);
  box-shadow: var(--shadow-glow);
}

.file-card-preview {
  height: 130px;
  background: rgba(10, 13, 20, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.file-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.file-card:hover .file-card-preview img {
  transform: scale(1.05);
}

.file-type-icon {
  font-size: 44px;
  transition: transform 0.2s ease;
}

.file-card:hover .file-type-icon {
  transform: scale(1.1);
}

.play-overlay-badge {
  position: absolute;
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.65);
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  backdrop-filter: blur(4px);
  transition: var(--transition);
}

.file-card:hover .play-overlay-badge {
  background: var(--primary);
  color: #000;
  border-color: var(--primary);
  transform: scale(1.1);
}

.file-card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.file-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
}

.file-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: auto;
}

/* List View Row Styling */
.file-grid.list-view .file-card {
  flex-direction: row;
  align-items: center;
  padding: 10px 16px;
}

.file-grid.list-view .file-card-preview {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  margin-right: 14px;
}

.file-grid.list-view .file-type-icon {
  font-size: 22px;
}

.file-grid.list-view .file-card-body {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 0;
}

.file-grid.list-view .file-name {
  max-width: 320px;
}

.file-grid.list-view .file-card-actions {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
  margin-left: 20px;
}

/* ================= EMPTY STATE ================= */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
}

.empty-icon {
  font-size: 50px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  max-width: 420px;
  margin: 0 auto 20px;
  font-size: 14px;
}

.empty-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* ================= BUTTONS & INPUTS ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #000;
  font-weight: 700;
}

.btn-primary:hover {
  box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn-secondary-soft {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.btn-secondary-soft:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.12);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(56, 189, 248, 0.08);
}

.btn-outline-danger {
  background: transparent;
  border-color: rgba(244, 63, 94, 0.4);
  color: var(--accent-danger);
}

.btn-outline-danger:hover {
  background: rgba(244, 63, 94, 0.1);
}

.btn-danger {
  background: var(--accent-danger);
  color: #fff;
}

.btn-danger:hover {
  background: #e11d48;
}

.btn-danger-soft {
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-danger);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.btn-danger-soft:hover {
  background: rgba(244, 63, 94, 0.2);
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
}

.btn-icon:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.btn-icon-white {
  color: #fff;
}

.btn-icon-white:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
}

.btn-link {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
}

/* Colors & Helpers */
.text-purple { color: var(--accent-purple); }
.text-emerald { color: var(--accent-emerald); }
.text-amber { color: var(--accent-amber); }
.text-cyan { color: var(--accent-cyan); }
.text-rose { color: var(--accent-rose); }
.text-sky { color: var(--primary); }
.text-danger { color: var(--accent-danger); }
.text-info { color: var(--primary); }
.text-secondary { color: var(--text-muted); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.bg-purple-soft { background: rgba(192, 132, 252, 0.12); }
.bg-emerald-soft { background: rgba(52, 211, 153, 0.12); }
.bg-amber-soft { background: rgba(251, 191, 36, 0.12); }
.bg-cyan-soft { background: rgba(34, 211, 238, 0.12); }

/* ================= MODALS ================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 7, 12, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.modal-card {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 700;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Form Groups in Modals */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
}

.field-help {
  font-size: 11px;
  color: var(--primary);
  font-weight: 400;
  text-decoration: none;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon i {
  position: absolute;
  left: 14px;
  color: var(--text-dim);
  font-size: 14px;
}

.input-with-icon input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 40px 10px 38px;
  font-size: 13.5px;
  color: var(--text-main);
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.input-with-icon input:focus {
  border-color: var(--primary);
}

.btn-reveal {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
}

.settings-alert {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-md);
  font-size: 12.5px;
  margin-bottom: 18px;
}

.settings-alert.info {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  color: var(--primary);
}

.settings-test-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0;
}

.test-status {
  font-size: 12.5px;
  font-weight: 600;
}

.settings-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 20px 0;
}

.db-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* ================= TOAST NOTIFICATIONS ================= */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: rgba(18, 24, 38, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 280px;
}

.toast.success { border-left: 4px solid var(--accent-emerald); }
.toast.error { border-left: 4px solid var(--accent-danger); }
.toast.info { border-left: 4px solid var(--primary); }

/* ================= ANIMATIONS ================= */
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.9); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ================= RESPONSIVE ================= */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

  .sidebar-backdrop.active {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 95;
  }

  .main-wrapper {
    margin-left: 0;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .content-container {
    padding: 16px;
  }
}

/* ================= FORM CONTROLS ================= */
.form-control {
  width: 100%;
  height: 46px;
  background: rgba(13, 17, 26, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: var(--text-main);
  font-size: 14px;
  font-family: inherit;
  padding: 0 16px;
  outline: none;
  transition: var(--transition);
  box-sizing: border-box;
}

.form-control:focus {
  border-color: var(--primary);
  background: rgba(18, 24, 38, 0.95);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25), 0 0 15px rgba(56, 189, 248, 0.15);
}

.form-control::placeholder {
  color: var(--text-dim);
}

/* ================= AUTHENTICATION & LOGIN UI ================= */
.login-modal-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.92), rgba(3, 7, 18, 0.98));
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 20px;
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-modal-overlay.active {
  display: flex;
}

.login-card {
  background: rgba(18, 24, 38, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 24px;
  width: 100%;
  max-width: 420px;
  padding: 40px 32px 36px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 45px rgba(56, 189, 248, 0.15);
  position: relative;
  overflow: hidden;
  animation: zoomIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #38bdf8, #818cf8, #c084fc);
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-brand-icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, #0284c7, #6366f1);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: #fff;
  box-shadow: 0 12px 28px -6px rgba(56, 189, 248, 0.45);
}

.login-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.login-form .form-group {
  margin-bottom: 20px;
}

.login-form .form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 8px;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.login-input-wrap i.input-icon {
  position: absolute;
  left: 16px;
  color: #64748b;
  font-size: 15px;
  pointer-events: none;
  z-index: 2;
}

.login-input-wrap .form-control {
  padding-left: 46px;
  padding-right: 46px;
}

.login-input-wrap .toggle-pass-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 8px;
  font-size: 15px;
  border-radius: 8px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.login-input-wrap .toggle-pass-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  font-size: 13px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
  cursor: pointer;
}

.login-alert {
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fda4af;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
  display: none;
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.login-btn {
  width: 100%;
  height: 48px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #0284c7, #6366f1);
  color: #ffffff;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 25px -5px rgba(56, 189, 248, 0.4);
  transition: var(--transition);
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px -5px rgba(56, 189, 248, 0.55);
  background: linear-gradient(135deg, #0ea5e9, #4f46e5);
}

.login-btn:active {
  transform: translateY(0);
}

/* User Profile Chip in Topbar */
.user-profile-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  transition: var(--transition);
}

.user-profile-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-color-glow);
}

.user-chip-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.user-chip-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-chip-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.user-chip-role {
  font-size: 10px;
  color: var(--primary);
  font-weight: 500;
}

.user-chip-logout {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  margin-left: 2px;
  transition: var(--transition);
}

.user-chip-logout:hover {
  color: var(--accent-danger);
  background: rgba(244, 63, 94, 0.15);
}

/* ================= PHOTO & MEDIA PREVIEW STYLING ================= */
.card-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: block;
}

.preview-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-preview-box {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* ================= DISK ANALYZER & TABLE STYLING ================= */
.status-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.status-tag.danger {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.status-tag.warning {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.status-tag.safe {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.file-name-cell {
  display: flex;
  align-items: center;
  font-weight: 600;
  color: #f8fafc;
}

.file-title-text {
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-path-sub {
  font-size: 11px;
  color: var(--text-dim);
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.badge-video { background: rgba(192, 132, 252, 0.15); color: #c084fc; }
.badge-photo { background: rgba(52, 211, 153, 0.15); color: #34d399; }
.badge-archive { background: rgba(251, 113, 133, 0.15); color: #fb7185; }
.badge-doc { background: rgba(34, 211, 238, 0.15); color: #22d3ee; }
.badge-audio { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }

.btn-primary-soft {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}
.btn-primary-soft:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #fff;
}

.btn-success-soft {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.25);
}

/* ================= PAGINATION STYLING ================= */
.pagination-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 10px;
  margin-top: 16px;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 14px;
}

.pag-info {
  font-size: 13px;
  color: var(--text-muted);
}

.pag-info strong {
  color: var(--text-main);
}

.pag-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pag-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.pag-btn:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--primary);
  color: #fff;
}

.pag-btn.active {
  background: linear-gradient(135deg, #0284c7, #6366f1);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.pag-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pag-ellipsis {
  padding: 0 4px;
  color: var(--text-dim);
  font-size: 13px;
}

.pag-size-selector .pag-select {
  background: rgba(13, 17, 26, 0.85);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.pag-size-selector .pag-select:hover,
.pag-size-selector .pag-select:focus {
  border-color: var(--primary);
}

/* ================= FLOATING BACKGROUND UPLOAD WIDGET ================= */
.floating-upload-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 320px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.7), 0 0 20px rgba(56, 189, 248, 0.2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 9999;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.upload-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.widget-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.widget-queue-badge {
  background: rgba(56, 189, 248, 0.2);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.widget-file-name {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 10px;
}

.widget-progress-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.widget-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  border-radius: 4px;
  transition: width 0.2s ease;
}

.widget-status-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: #f8fafc;
}

/* ================= MOBILE BOTTOM NAVIGATION BAR ================= */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(13, 17, 26, 0.96);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 9000;
  justify-content: space-around;
  align-items: center;
  padding: 0 10px;
}

.mob-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 10px;
  transition: var(--transition);
}

.mob-nav-item i {
  font-size: 18px;
}

.mob-nav-item.active,
.mob-nav-item:active,
.mob-nav-item:hover {
  color: var(--primary);
  background: rgba(56, 189, 248, 0.1);
}

/* ================= MOBILE RESPONSIVE TWEAKS ================= */
@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
  }

  .content-container {
    padding-bottom: 80px !important;
  }

  .floating-upload-widget {
    bottom: 74px;
    right: 12px;
    left: 12px;
    width: auto;
  }

  .file-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .file-card-preview {
    height: 120px !important;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .topbar {
    padding: 10px 14px !important;
    gap: 10px !important;
  }

  .search-container {
    max-width: 100% !important;
  }

  .user-profile-chip .user-chip-info {
    display: none;
  }

  .modal-card {
    width: 95vw !important;
    max-height: 88vh !important;
    margin: 10px !important;
    padding: 18px !important;
  }

  .disk-hero {
    flex-direction: column;
    padding: 16px !important;
  }

  .disk-info-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
}

@media (max-width: 480px) {
  .file-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  .file-name {
    font-size: 12px !important;
  }

  .file-meta-row {
    font-size: 10px !important;
  }
}





