/* ==========================================================================
   LiteDrive - Ultra-Polished Liquid Glassmorphism & Mobile App Bar Layout
   ========================================================================== */
:root {
  --font-family: 'Plus Jakarta Sans', 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Deep Liquid Glass Palette */
  --bg-color: #080c14;
  --bg-glass-card: rgba(22, 32, 50, 0.65);
  --bg-glass-card-hover: rgba(36, 52, 78, 0.85);
  --bg-glass-header: rgba(13, 20, 34, 0.85);
  --bg-glass-modal: #0f172a;

  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-border-hover: rgba(255, 255, 255, 0.28);
  --glass-specular: linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.03) 100%);
  --glass-specular-glow: rgba(59, 130, 246, 0.3);

  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-subtle: #64748b;

  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  --accent-light: rgba(59, 130, 246, 0.22);
  --accent-glow: 0 0 24px rgba(59, 130, 246, 0.45);

  --accent-star: #fbbf24;
  --accent-danger: #f43f5e;
  --accent-success: #10b981;
  --accent-warning: #f59e0b;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --shadow-glass: 0 16px 38px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-color: #f1f5f9;
  --bg-glass-card: rgba(255, 255, 255, 0.85);
  --bg-glass-card-hover: rgba(255, 255, 255, 0.98);
  --bg-glass-header: rgba(255, 255, 255, 0.9);
  --bg-glass-modal: #ffffff;

  --glass-border: rgba(0, 0, 0, 0.12);
  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #94a3b8;

  --shadow-glass: 0 16px 36px rgba(0, 0, 0, 0.1), inset 0 1px 1px rgba(255, 255, 255, 0.8);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  overflow: hidden;
  user-select: none;
  position: relative;
}

/* AMBIENT NEON GLOW BLOBS */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.25;
}

.glow-1 { width: 500px; height: 500px; top: -150px; left: -150px; background: radial-gradient(circle, rgba(99, 102, 241, 0.5), transparent 70%); }
.glow-2 { width: 550px; height: 550px; bottom: -200px; right: -150px; background: radial-gradient(circle, rgba(236, 72, 153, 0.5), transparent 70%); }
.glow-3 { width: 400px; height: 400px; top: 35%; left: 42%; background: radial-gradient(circle, rgba(16, 185, 129, 0.4), transparent 70%); }

/* APP LAYOUT */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  position: relative;
}

/* SIDEBAR OVERLAY FOR MOBILE */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 400;
  display: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* SIDEBAR */
.sidebar {
  width: 280px;
  background: var(--bg-glass-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 10;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--glass-specular);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 0 8px;
}

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

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.45);
}

.brand-icon i { width: 24px; height: 24px; }

.brand-name {
  font-size: 1.38rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #60a5fa, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
}

.sidebar-close-btn:hover {
  background: var(--bg-glass-card-hover);
  color: var(--text-main);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  min-height: 44px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--glass-border);
  transition: var(--transition);
  outline: none;
  position: relative;
  overflow: hidden;
}

.btn-block { width: 100%; }

.btn-primary {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: white;
  border: none;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(59, 130, 246, 0.65);
  background: linear-gradient(135deg, #2563eb, #4f46e5);
}

.btn-secondary {
  background: var(--bg-glass-card);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--bg-glass-card-hover);
  border-color: var(--accent-primary);
  color: #60a5fa;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
}

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

.btn-danger:hover {
  background: var(--accent-danger);
  color: white;
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.45);
}

.btn-sm {
  padding: 6px 14px;
  min-height: 36px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-subtle);
  padding: 14px 12px 6px;
}

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

.nav-link i { width: 20px; height: 20px; }

.nav-link:hover {
  background: var(--bg-glass-card-hover);
  color: var(--text-main);
  transform: translateX(4px);
}

.nav-link.active {
  background: var(--accent-light);
  color: #60a5fa;
  font-weight: 700;
  border: 1px solid rgba(59, 130, 246, 0.35);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25);
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  bottom: 15%;
  width: 4px;
  background: #3b82f6;
  border-radius: 4px;
  box-shadow: 0 0 10px #3b82f6;
}

/* STORAGE WIDGET */
.storage-widget {
  background: var(--bg-glass-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-glass);
}

.storage-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.storage-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
}

.storage-title i { width: 16px; height: 16px; color: #60a5fa; }
.storage-used { font-size: 0.78rem; color: var(--text-muted); font-weight: 700; }

.progress-bar-bg {
  height: 8px;
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #ec4899);
  border-radius: 6px;
  transition: width 0.4s ease;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.7);
}

.storage-details { font-size: 0.75rem; color: var(--text-subtle); text-align: right; }

/* USER PROFILE BADGE */
.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-glass-card);
  padding: 5px 12px 5px 6px;
  border-radius: 24px;
  border: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.user-avatar-wrapper {
  position: relative;
  display: inline-block;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #3b82f6);
  color: white;
  font-weight: 800;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.online-pulse {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: #10b981;
  border: 2px solid var(--bg-color);
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
}

.user-details { display: flex; flex-direction: column; }
.user-name { font-size: 0.84rem; font-weight: 700; line-height: 1.1; }
.user-role-tag { font-size: 0.65rem; font-weight: 800; color: #60a5fa; letter-spacing: 0.5px; }

/* MAIN CONTENT */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: transparent;
}

/* TOP HEADER */
.top-header {
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--bg-glass-header);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-glass);
  position: relative;
  z-index: 20;
}

.top-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--glass-specular);
}

.header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.mobile-menu-btn {
  display: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.mobile-brand-title {
  display: none;
  font-size: 1.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #60a5fa, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  flex-shrink: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-glass-card);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--bg-glass-card-hover);
  color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glass);
}

.icon-btn i { width: 20px; height: 20px; }

.search-bar-row {
  width: 100%;
  display: flex;
  align-items: center;
}

.search-bar-wrapper {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-bar-wrapper input {
  width: 100%;
  padding: 12px 40px 12px 44px;
  border-radius: var(--radius-md);
  background: var(--bg-glass-card);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  font-size: 16px;
  outline: none;
  transition: var(--transition);
}

.search-bar-wrapper input:focus {
  border-color: var(--accent-primary);
  box-shadow: var(--accent-glow);
}

.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
}

/* DESKTOP HEADER OVERRIDES */
@media (min-width: 769px) {
  .top-header {
    height: 72px;
    padding: 0 24px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;

  }

  .header-top-row {
    width: auto;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .search-bar-row {
    width: 360px;
    order: -1;
    margin-right: 16px;
  }

  .search-bar-wrapper input {
    padding: 10px 38px 10px 42px;
  }
}

/* DROPDOWN MENU */
.dropdown { position: relative; }

.dropdown-menu {
  position: absolute;
  right: 0;
  top: 52px;
  width: 220px;
  background: var(--bg-glass-modal);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glass);
  padding: 8px;
  display: none;
  z-index: 100;
}

.dropdown-menu.show { display: block; animation: fadeIn 0.15s ease-out; }
.dropdown-header { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; color: var(--text-subtle); padding: 8px 10px 4px; }

.dropdown-item {
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}

.dropdown-item:hover { background: var(--bg-glass-card-hover); color: var(--text-main); }
.dropdown-item.active { color: #60a5fa; font-weight: 700; background: var(--accent-light); }

/* CONTENT BODY */
.content-body {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
}

.content-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.breadcrumbs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.crumb-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.crumb-item:hover { color: #60a5fa; }
.crumb-item.active { color: var(--text-main); cursor: default; }
.crumb-separator { color: var(--text-subtle); font-size: 0.9rem; }

.quick-stats {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg-glass-card);
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  font-weight: 600;
}

/* ITEMS VIEW */
.items-view.grid-mode {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 18px;
  align-content: start;
}

.items-view.list-mode {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ITEM CARD */
.item-card {
  background: var(--bg-glass-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-glass);
  overflow: hidden;
}

.item-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--glass-specular);
}

.item-card:hover {
  background: var(--bg-glass-card-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.5), 0 0 24px var(--glass-specular-glow);
}

.item-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.item-icon-wrapper {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent-primary);
  border: 1px solid var(--glass-border);
}

.item-icon-wrapper i { width: 24px; height: 24px; }

.item-icon-wrapper.folder-icon { background: rgba(245, 158, 11, 0.18); color: #fbbf24; border-color: rgba(245, 158, 11, 0.3); }
.item-icon-wrapper.image-icon { background: rgba(16, 185, 129, 0.18); color: #34d399; border-color: rgba(16, 185, 129, 0.3); }
.item-icon-wrapper.media-icon { background: rgba(236, 72, 153, 0.18); color: #f472b6; border-color: rgba(236, 72, 153, 0.3); }
.item-icon-wrapper.code-icon { background: rgba(99, 102, 241, 0.18); color: #818cf8; border-color: rgba(99, 102, 241, 0.3); }

/* FILE TYPE EXTENSION BADGE */
.file-type-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.item-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.star-btn, .more-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  min-width: 34px;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.star-btn:hover { color: var(--accent-star); background: rgba(251, 191, 36, 0.15); }
.star-btn.starred { color: var(--accent-star); fill: var(--accent-star); }
.more-btn:hover { color: var(--text-main); background: var(--accent-light); }

.item-thumbnail {
  width: 100%;
  height: 115px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  margin-bottom: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
}

.item-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.item-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* List Mode */
.items-view.list-mode .item-card { flex-direction: row; align-items: center; padding: 12px 18px; }
.items-view.list-mode .item-card-top { margin-bottom: 0; margin-right: 18px; }
.items-view.list-mode .item-thumbnail { display: none; }
.items-view.list-mode .item-info-wrap { flex: 1; display: flex; align-items: center; justify-content: space-between; }
.items-view.list-mode .item-name { margin-bottom: 0; width: 280px; }

/* DROP ZONE OVERLAY */
.drop-zone {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 20, 0.92);
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 28px;
}

.drop-zone.active {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.drop-zone-card {
  border: 2px dashed #60a5fa;
  border-radius: var(--radius-lg);
  padding: 52px;
  text-align: center;
  background: var(--bg-glass-modal);
  color: #60a5fa;
  box-shadow: 0 0 60px rgba(59, 130, 246, 0.55);
  max-width: 480px;
  width: 100%;
}

.drop-zone-card i { width: 64px; height: 64px; margin-bottom: 16px; }
.drop-zone-card h3 { font-size: 1.25rem; font-weight: 800; color: var(--text-main); margin-bottom: 8px; }
.drop-zone-card p { font-size: 0.9rem; color: var(--text-muted); }

/* EMPTY STATE */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  text-align: center;
  flex: 1;
}

.empty-icon {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--bg-glass-card);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.empty-icon i { width: 38px; height: 38px; }
.empty-state h3 { font-size: 1.3rem; font-weight: 800; margin-bottom: 8px; }
.empty-state p { font-size: 0.9rem; color: var(--text-muted); max-width: 380px; margin-bottom: 24px; }

/* MODALS */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 20, 0.82);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.show {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-glass-modal);
  border: 1px solid var(--glass-border-hover);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  width: 100%;
  max-width: 460px;
  overflow: hidden;
  transform: translateY(20px) scale(0.96);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.modal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--glass-specular);
}

.modal-overlay.show .modal-card { transform: translateY(0) scale(1); }
.modal-card.modal-lg { max-width: 860px; }

.login-card { max-width: 410px; }
.login-header { text-align: center; padding: 32px 24px 16px; }
.login-brand-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.5);
}

.login-brand-icon i { width: 30px; height: 30px; }
.login-header h2 { font-size: 1.45rem; font-weight: 800; margin-bottom: 6px; }
.login-header p { font-size: 0.88rem; color: var(--text-muted); }
.login-body { padding: 0 24px 32px; }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.84rem; font-weight: 700; color: var(--text-muted); margin-bottom: 6px; }
.form-group input, .form-group select {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  font-size: 16px;
  outline: none;
  transition: var(--transition);
}

.form-group input:focus, .form-group select:focus {
  border-color: var(--accent-primary);
  box-shadow: var(--accent-glow);
}

/* ADMIN TABLES */
.admin-section-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 18px;
}

.admin-section-box h4 { font-size: 0.92rem; font-weight: 800; margin-bottom: 14px; color: #60a5fa; }

.form-inline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  align-items: center;
}

.form-inline-grid input, .form-inline-grid select {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  font-size: 16px;
  outline: none;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  max-height: 380px;
  overflow-y: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.data-table th, .data-table td { padding: 12px 14px; border-bottom: 1px solid var(--glass-border); white-space: nowrap; }
.data-table th { background: rgba(13, 20, 36, 0.85); color: var(--text-subtle); font-size: 0.75rem; font-weight: 800; text-transform: uppercase; position: sticky; top: 0; z-index: 10; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.05); }

.badge { display: inline-block; padding: 4px 10px; border-radius: 12px; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; }
.badge-success { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge-danger { background: rgba(244, 63, 94, 0.2); color: #fb7185; }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }

.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--glass-border); display: flex; align-items: center; justify-content: space-between; }
.modal-header h3 { font-size: 1.15rem; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; display: flex; padding: 8px; border-radius: 6px; }
.modal-close:hover { color: var(--text-main); background: var(--bg-glass-card-hover); }
.modal-body { padding: 24px; }

.modal-footer { padding: 18px 24px; border-top: 1px solid var(--glass-border); display: flex; justify-content: flex-end; gap: 12px; background: rgba(0, 0, 0, 0.25); }

/* PREVIEW & SHARE */
.preview-title-wrap { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; font-weight: 700; }
.preview-actions { display: flex; align-items: center; gap: 10px; }
.preview-body { display: flex; align-items: center; justify-content: center; min-height: 320px; max-height: 70vh; overflow: auto; background: rgba(0,0,0,0.4); padding: 16px; }
.preview-body img { max-width: 100%; max-height: 60vh; object-fit: contain; border-radius: var(--radius-md); }
.preview-body video, .preview-body audio { width: 100%; max-height: 60vh; outline: none; }
.preview-code-block { width: 100%; background: rgba(13, 20, 36, 0.9); border-radius: var(--radius-md); padding: 18px; font-family: monospace; font-size: 0.88rem; white-space: pre-wrap; word-break: break-all; color: var(--text-main); max-height: 55vh; overflow-y: auto; }

.share-input-group { display: flex; gap: 10px; margin-top: 12px; }
.share-input-group input { flex: 1; }
.alert-success { margin-top: 12px; padding: 12px 16px; background: rgba(16, 185, 129, 0.2); border: 1px solid var(--accent-success); color: #34d399; border-radius: var(--radius-md); font-size: 0.88rem; display: flex; align-items: center; gap: 10px; }

/* CONTEXT MENU */
.context-menu {
  position: fixed;
  background: var(--bg-glass-modal);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glass);
  width: 220px;
  padding: 8px;
  display: none;
  z-index: 600;
}

.context-menu.show { display: block; animation: fadeIn 0.15s ease-out; }
.context-item { width: 100%; padding: 12px 14px; background: none; border: none; border-radius: var(--radius-sm); color: var(--text-muted); font-size: 0.9rem; text-align: left; cursor: pointer; display: flex; align-items: center; gap: 12px; transition: var(--transition); }
.context-item i { width: 18px; height: 18px; }
.context-item:hover { background: var(--bg-glass-card-hover); color: var(--text-main); }
.context-item.danger:hover { background: rgba(244, 63, 94, 0.2); color: var(--accent-danger); }
.context-divider { height: 1px; background: var(--glass-border); margin: 6px 0; }

/* TOAST NOTIFICATIONS */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  left: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  z-index: 700;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  max-width: 420px;
  width: 100%;
  background: var(--bg-glass-modal);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glass);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideUp 0.25s ease-out;
}

.toast.toast-success i { color: #34d399; }
.toast.toast-error i { color: #fb7185; }

/* MOBILE FLOATING ACTION BUTTON (FAB) */
.mobile-fab-btn {
  display: none;
  position: fixed;
  bottom: max(24px, env(safe-area-inset-bottom, 24px));
  right: max(24px, env(safe-area-inset-right, 24px));
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.65), 0 0 20px rgba(99, 102, 241, 0.4);
  z-index: 350;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}

.mobile-fab-btn:active { transform: scale(0.90); }
.mobile-fab-btn i { width: 28px; height: 28px; }

/* MEDIA QUERIES FOR SMARTPHONE & TABLET */
@media (min-width: 769px) {
  .sidebar-overlay {
    display: none !important;
  }
}

@media (max-width: 768px) {
  html, body {
    height: 100%;
    height: 100dvh;
    overflow: hidden;
  }

  .app-layout {
    height: 100%;
    height: 100dvh;
  }

  .main-content {
    height: 100%;
    height: 100dvh;
  }

  .content-body {
    padding: 14px 14px 110px 14px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

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

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 290px;
    height: 100vh;
    height: 100dvh;
    z-index: 500 !important;
    transform: translateX(-100%);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.85);
  }

  .sidebar.show-mobile {
    transform: translateX(0) !important;
  }

  .sidebar-close-btn { display: flex; }
  
  .mobile-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
  }

  .mobile-brand-title {
    display: inline-block;
    font-size: 1.15rem;
  }

  .desktop-only-btn {
    display: none !important;
  }

  .top-header {
    padding: 8px 12px;
    gap: 6px;
  }

  .header-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 4px;
  }

  .header-left {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 1;
    min-width: 0;
  }

  .mobile-menu-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex-shrink: 0;
  }

  .mobile-brand-title {
    display: inline-block;
    font-size: 1.05rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
  }

  .header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    flex-shrink: 0;
  }

  .icon-btn i {
    width: 18px;
    height: 18px;
  }

  .hide-mobile-text { display: none; }
  .hide-mobile-user { display: none; }
  
  .user-profile-badge {
    padding: 2px;
    border-radius: 50%;
    border: none;
    background: transparent;
    flex-shrink: 0;
  }

  .user-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }

  .search-bar-row {
    width: 100%;
    margin-top: 2px;
  }

  .search-bar-wrapper input {
    height: 38px;
    padding: 8px 34px 8px 34px;
    font-size: 16px !important;
    border-radius: 12px;
  }

  .search-icon {
    left: 10px;
    width: 16px;
    height: 16px;
  }

  .content-top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .items-view.grid-mode {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .items-view.list-mode .item-card {
    padding: 10px 12px;
    gap: 10px;
  }

  .item-card {
    padding: 10px;
    touch-action: manipulation;
  }

  .item-name {
    font-size: 0.82rem;
    line-height: 1.25;
    margin-bottom: 3px;
  }

  .item-meta {
    font-size: 0.7rem;
  }

  .form-group input, .form-group select, .search-bar-wrapper input {
    font-size: 16px !important; /* Prevents auto-zoom on iOS Safari */
  }

  .form-inline-grid {
    grid-template-columns: 1fr;
  }

  .modal-card {
    width: calc(100% - 20px);
    max-height: 85dvh;
    margin: auto;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
  }

  .modal-body {
    padding: 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-header {
    padding: 16px;
  }

  .modal-footer {
    padding: 14px 16px;
    gap: 8px;
  }

  .toast-container {
    left: 12px;
    right: 12px;
    bottom: max(16px, env(safe-area-inset-bottom, 16px));
  }

  .toast {
    font-size: 0.84rem;
    padding: 12px 16px;
  }
}

@media (max-width: 480px) {
  .items-view.grid-mode {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .item-card-top {
    margin-bottom: 8px;
  }

  .item-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .item-icon-wrapper i {
    width: 20px;
    height: 20px;
  }

  .file-type-badge {
    font-size: 0.62rem;
    padding: 2px 6px;
  }

  .context-menu {
    width: 200px;
    max-width: 88vw;
    padding: 6px;
  }

  .context-item {
    padding: 10px 12px;
    font-size: 0.85rem;
    gap: 10px;
  }

  .public-portal-card {
    padding: 20px 16px;
    border-radius: var(--radius-md);
  }
}

@keyframes fadeIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

