/* ==========================================================================
   MyStorage Design System & Stylesheet (With Auth & Admin Panel)
   ========================================================================== */

:root {
  /* Color Palette - Dark Theme Defaults */
  --bg-primary: #0f111a;
  --bg-secondary: #161926;
  --bg-tertiary: #1f2436;
  --bg-glass: rgba(22, 25, 38, 0.85);
  --bg-card: rgba(31, 36, 54, 0.6);
  --bg-card-hover: rgba(43, 50, 74, 0.8);
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-hover: rgba(129, 140, 248, 0.4);
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-subtle: #6b7280;
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.15);
  --primary-glow: rgba(99, 102, 241, 0.35);
  
  --accent-purple: #8b5cf6;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-orange: #f59e0b;
  --accent-red: #ef4444;
  --accent-pink: #ec4899;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px var(--primary-glow);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-brand: 'Outfit', sans-serif;
  --font-code: 'Fira Code', 'Consolas', monospace;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-glass: rgba(255, 255, 255, 0.88);
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  
  --border-color: #e2e8f0;
  --border-color-hover: rgba(99, 102, 241, 0.4);
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Typography & Utilities */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-brand);
  font-weight: 700;
  line-height: 1.2;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: none;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

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

.text-admin {
  color: var(--accent-orange) !important;
}

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.p-0 { padding: 0 !important; }

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}

/* Auth Card & Modal */
.auth-card {
  max-width: 420px;
  padding: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.auth-header {
  padding: 2rem 1.75rem 1rem 1.75rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

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

.auth-tabs {
  margin: 0 1.75rem;
}

.quick-credentials-hint {
  font-size: 0.78rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--text-main);
  line-height: 1.4;
}

/* Public Shared File Landing Page */
.public-share-page {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top center, rgba(99, 102, 241, 0.15), var(--bg-primary) 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 1000;
  overflow-y: auto;
}

.public-share-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  padding: 2.25rem;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  backdrop-filter: blur(12px);
  animation: fadeIn 0.3s ease-out;
}

.public-share-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.share-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.public-file-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
}

.public-file-preview {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.public-file-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.public-file-preview i {
  width: 60px;
  height: 60px;
  color: var(--primary);
}

.public-file-name {
  font-size: 1.3rem;
  margin-bottom: 0.3rem;
  word-break: break-word;
}

.public-file-meta {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.public-file-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  margin-top: 0.75rem;
}

.btn-lg {
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
}

.password-protect-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.lock-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-orange);
  display: flex;
  align-items: center;
  justify-content: center;
}

.public-share-footer {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.public-share-footer a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  transition: color var(--transition-fast);
}

/* Layout App Container */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
}

/* Sidebar Backdrop Overlay */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 90;
  animation: fadeIn 0.2s ease-out;
}

/* Sidebar Styles */
.sidebar {
  width: 280px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.25rem;
  z-index: 100;
  transition: transform var(--transition-normal);
  flex-shrink: 0;
}

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

.mobile-close-sidebar {
  display: none;
}

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

.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.brand-name {
  font-family: var(--font-brand);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-name .highlight {
  color: var(--primary);
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

/* Nav Menu */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  margin-right: -0.5rem;
  padding-right: 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.nav-section-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  font-weight: 700;
  margin: 1rem 0 0.4rem 0.5rem;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.nav-item .nav-link:hover, .nav-item .nav-link:active {
  background-color: var(--bg-tertiary);
  color: var(--text-main);
}

.nav-item.active .nav-link {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.nav-admin-item.active .nav-link {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-orange);
}

.badge {
  margin-left: auto;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.badge-star { background: rgba(245, 158, 11, 0.15); color: var(--accent-orange); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); }
.badge-info { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }

/* Category Icons Colors */
.cat-image { color: var(--accent-purple); }
.cat-doc { color: var(--accent-blue); }
.cat-audio { color: var(--accent-green); }
.cat-video { color: var(--accent-pink); }
.cat-code { color: var(--accent-orange); }

/* Tag Chips */
.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.25rem 0.5rem;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tag-chip:active {
  transform: scale(0.96);
}

.tag-work { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.tag-personal { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.tag-urgent { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.tag-project { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }

/* Storage Widget */
.storage-widget {
  margin-top: 1rem;
  padding: 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
}

.storage-widget-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.progress-bar-bg {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent-purple));
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

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

/* Main Content Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--bg-primary);
  position: relative;
}

/* Top Header */
.top-header {
  height: 65px;
  padding: 0 1.25rem;
  background-color: var(--bg-glass);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  z-index: 10;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.search-box {
  position: relative;
  width: 280px;
}

.search-box input {
  width: 100%;
  padding: 0.55rem 1rem 0.55rem 2.3rem;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-main);
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-subtle);
  pointer-events: none;
}

/* User Profile */
.user-profile {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-left: 0.5rem;
  border-left: 1px solid var(--border-color);
  cursor: pointer;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-purple));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.82rem;
}

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

.user-name {
  font-size: 0.88rem;
  font-weight: 600;
}

.user-plan {
  font-size: 0.72rem;
  color: var(--accent-purple);
  font-weight: 600;
}

/* Workspace Layout */
.workspace {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.25rem 5rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  -webkit-overflow-scrolling: touch;
}

/* ADMIN PANEL STYLING */
.admin-panel-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeIn 0.25s ease-out;
}

.admin-header-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(139, 92, 246, 0.15));
  border: 1px solid var(--accent-orange);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(10px);
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-orange);
  background: rgba(245, 158, 11, 0.2);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.5rem;
}

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

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

.icon-users { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.icon-files { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.icon-storage { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.icon-shares { background: rgba(236, 72, 153, 0.15); color: #f472b6; }
.icon-trash-admin { background: rgba(239, 68, 68, 0.15); color: #f87171; }

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

.stat-num {
  font-size: 1.4rem;
  font-weight: 800;
  font-family: var(--font-brand);
}

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

.admin-table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.admin-table-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-tertiary);
}

.admin-users-table th, .admin-users-table td {
  padding: 0.85rem 1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.88rem;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  color: #ffffff;
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

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

.btn-block {
  width: 100%;
}

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

.btn-outline-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.icon-btn:active {
  background-color: var(--bg-tertiary);
  color: var(--text-main);
}

/* Segmented Control */
.segmented-control {
  display: flex;
  background: var(--bg-tertiary);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.segment-btn {
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.segment-btn.active {
  background: var(--bg-secondary);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Dropdown Menu */
.dropdown-wrapper {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  min-width: 200px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-fast);
}

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

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: left;
  transition: background var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-main);
}

/* Mobile Bottom Navigation Bar */
.bottom-nav-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 62px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  z-index: 80;
  align-items: center;
  justify-content: space-around;
  padding: 0 0.5rem;
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

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

.bottom-nav-upload-btn {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
  transform: translateY(-8px);
}

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

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
}

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

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
}

/* File Drop Zone Area in Modal */
.file-drop-area {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: var(--bg-tertiary);
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.file-drop-area:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.drop-area-icon {
  width: 48px;
  height: 48px;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.modal-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

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

.form-control {
  padding: 0.6rem 0.85rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.88rem;
}

/* Toast Container */
.toast-container {
  position: fixed;
  bottom: 5rem;
  left: 1rem;
  right: 1rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  color: var(--text-main);
  font-size: 0.85rem;
}

/* Media Queries */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 280px;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
    z-index: 200;
  }

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

  .mobile-close-sidebar {
    display: flex;
  }

  .bottom-nav-bar {
    display: flex;
  }

  .search-box {
    width: 160px;
  }

  .hide-mobile {
    display: none !important;
  }

  .top-header {
    padding: 0 0.85rem;
  }

  .workspace {
    padding: 1rem 0.85rem 5.5rem 0.85rem;
  }

  .admin-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Template and Access Control Badges */
.view-access-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  z-index: 2;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
}

.admin-badge-glow {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.template-badge-glow {
  background: rgba(99, 102, 241, 0.25);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.4);
}

.public-badge-glow {
  background: rgba(236, 72, 153, 0.25);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.4);
}

.template-preview-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.template-preview-wrapper img.template-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-access-notice {
  font-size: 0.82rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.notice-admin {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.notice-restricted {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

/* Hide native file input element */
.hidden-file-input {
  display: none !important;
}

/* AI Agent Floating Widget & Chat Drawer */
.ai-agent-trigger-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 450;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--accent-purple), var(--accent-pink));
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.ai-agent-trigger-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.6);
}

.ai-trigger-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulseGlow 2s infinite alternate;
}

@keyframes pulseGlow {
  0% { transform: scale(1); filter: drop-shadow(0 0 2px #fff); }
  100% { transform: scale(1.2); filter: drop-shadow(0 0 8px #a5b4fc); }
}

.ai-agent-drawer {
  position: fixed;
  bottom: 85px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 110px);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), var(--shadow-glow);
  z-index: 460;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.ai-drawer-header {
  padding: 1rem 1.25rem;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-brand-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ai-avatar-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--accent-pink));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

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

.ai-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
}

.ai-status-badge {
  font-size: 0.72rem;
  color: var(--accent-green);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}

.ai-drawer-body {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: rgba(15, 17, 26, 0.4);
}

.ai-message {
  display: flex;
  gap: 0.6rem;
  max-width: 88%;
}

.ai-msg-incoming {
  align-self: flex-start;
}

.ai-msg-outgoing {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.msg-bubble {
  padding: 0.75rem 0.95rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  line-height: 1.45;
}

.ai-msg-incoming .msg-bubble {
  background: var(--bg-tertiary);
  color: var(--text-main);
  border-top-left-radius: 2px;
  border: 1px solid var(--border-color);
}

.ai-msg-outgoing .msg-bubble {
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  color: #ffffff;
  border-top-right-radius: 2px;
}

.ai-quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.ai-chip {
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ai-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.ai-drawer-footer {
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

.ai-input-form {
  display: flex;
  gap: 0.5rem;
}

.ai-input-form input {
  flex: 1;
}

@media (max-width: 480px) {
  .ai-agent-drawer {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 80px;
  }
}

/* Trash Actions Bar */
.trash-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  backdrop-filter: blur(8px);
}

/* Hero Showcase Banner for Demo Mode */
.hero-showcase-container {
  width: 100%;
  margin-bottom: 2rem;
}

.hero-showcase-card {
  position: relative;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(168, 85, 247, 0.3);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), var(--glow-primary);
  background: var(--bg-card);
}

.hero-showcase-img {
  width: 100%;
  height: auto;
  max-height: 75vh;
  object-fit: contain;
  display: block;
  background: var(--bg-primary);
  margin: 0 auto;
}

.hero-overlay-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(0deg, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0.6) 80%, transparent 100%);
  padding: 1.75rem 2rem 1.5rem;
  backdrop-filter: blur(10px);
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.hero-badge-header {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #c084fc;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-badge-title {
  font-size: 1.8rem;
  font-weight: 800;
  font-family: var(--font-brand);
  background: linear-gradient(135deg, #ffffff 0%, #d8b4fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}

.hero-badge-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0;
  line-height: 1.5;
}

.hero-badge-actions {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

/* Status Badges */
.badge-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-approved {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Notice Modal Box */
.notice-modal-icon {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-full);
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin: 0 auto;
}

.status-notice-box {
  padding: 0.85rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-align: left;
}

.btn-warning {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4) !important;
}

.btn-warning:hover {
  background: linear-gradient(135deg, #d97706, #b45309) !important;
  color: #ffffff !important;
  transform: translateY(-1px);
}
