/* ═══════════════════════════════════════════
   CloudStorage — Premium Dark Theme
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg-deepest: #05050a;
  --bg-primary: #080812;
  --bg-surface: #0c0c1a;
  --bg-elevated: #111122;
  --bg-card: #14142a;
  --bg-card-hover: #1a1a34;
  --border-faint: rgba(255, 255, 255, 0.04);
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-medium: rgba(255, 255, 255, 0.12);
  --text-primary: #f0f0f8;
  --text-secondary: #c8c8e0;
  --text-tertiary: #9090b0;
  --text-muted: #6868a0;
  --accent: #7c7cf8;
  --accent-hover: #6363f0;
  --accent-soft: rgba(124, 124, 248, 0.12);
  --accent-glow: rgba(124, 124, 248, 0.2);
  --success: #5ce5b8;
  --success-bg: rgba(92, 229, 184, 0.1);
  --success-border: rgba(92, 229, 184, 0.2);
  --error: #f87171;
  --error-bg: rgba(248, 113, 113, 0.1);
  --error-border: rgba(248, 113, 113, 0.2);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 28px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(124, 124, 248, 0.08);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── Reset & Base ─── */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* ─── Custom Scrollbar ─── */

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 3px;
  transition: background 0.3s ease;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Animations ─── */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

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

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-16px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 12px var(--accent-glow); }
  50%      { box-shadow: 0 0 28px var(--accent-glow); }
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(-120%) scale(0.9); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastSlideOut {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to   { opacity: 0; transform: translateX(-120%) scale(0.9); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

@keyframes progressPulse {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

/* ─── Page Transition ─── */

.page-enter { animation: fadeInUp 0.55s var(--ease-out) forwards; }
.page-enter-d1 { animation: fadeInUp 0.5s var(--ease-out) 0.05s forwards; opacity: 0; }
.page-enter-d2 { animation: fadeInUp 0.5s var(--ease-out) 0.10s forwards; opacity: 0; }
.page-enter-d3 { animation: fadeInUp 0.5s var(--ease-out) 0.15s forwards; opacity: 0; }
.page-enter-d4 { animation: fadeInUp 0.5s var(--ease-out) 0.22s forwards; opacity: 0; }
.page-enter-d5 { animation: fadeInUp 0.5s var(--ease-out) 0.30s forwards; opacity: 0; }
.page-enter-d6 { animation: fadeInUp 0.5s var(--ease-out) 0.38s forwards; opacity: 0; }

/* ─── Navbar ─── */

/* ─── Container ─── */

.container {
  max-width: 1100px;
  padding-top: calc(56px + 2rem);
  padding-bottom: 4rem;
}

/* ─── Typography ─── */

h1 {
  font-weight: 800;
  font-size: 1.75rem;
  color: var(--text-primary);
  margin-bottom: 1.5rem !important;
  letter-spacing: -0.025em;
}

h2 {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-primary);
  margin-bottom: 1.25rem !important;
  letter-spacing: -0.015em;
}

/* ─── Auth Pages ─── */

/* ─── Flash Messages ─── */

.flash-msg {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}
.flash-msg.flash-success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success);
}
.flash-msg.flash-error {
  background: var(--error-bg);
  border-color: var(--error-border);
  color: var(--error);
}
.flash-msg i { margin-right: 0.4rem; }
.flash-msg:empty { display: none; }

.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 130px);
  animation: fadeIn 0.5s ease;
  padding: 1rem 0;
}

.auth-card {
  background: var(--bg-card);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  padding: 2.75rem 2.5rem;
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--border-subtle);
  animation: scaleIn 0.5s var(--ease-spring);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), #a78bfa, var(--accent), transparent);
  background-size: 200% 100%;
  animation: shimmer 4s linear infinite;
}

.auth-card h1 {
  text-align: center;
  margin-bottom: 2rem !important;
  font-size: 1.4rem;
}

.auth-card .form-group { margin-bottom: 1.25rem; }

.auth-card .btn {
  width: 100%;
  padding: 0.8rem;
  margin-top: 0.75rem;
  font-size: 0.95rem;
  justify-content: center;
}

.auth-card p {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-card p a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  position: relative;
}

.auth-card p a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width 0.3s var(--ease-out);
}

.auth-card p a:hover::after { width: 100%; }

.auth-logo {
  text-align: center;
  margin-bottom: 1rem;
  font-size: 2.4rem;
  color: var(--accent);
  animation: float 4s ease-in-out infinite;
  filter: drop-shadow(0 0 20px var(--accent-glow));
}

.password-wrapper {
  position: relative;
}

.password-wrapper .form-control {
  padding-right: 2.75rem;
}

.password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.password-toggle:hover { color: var(--text-secondary); }

/* ─── Upload Card ─── */

.card-upload {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  padding: 2rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border-faint);
  transition: border-color 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}

.card-upload:focus-within {
  border-color: rgba(124, 124, 248, 0.2);
  box-shadow: var(--shadow-md), 0 0 40px rgba(124, 124, 248, 0.06);
}

/* ─── Drop Zone ─── */

.drop-zone {
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-md);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.35s var(--ease-out);
  position: relative;
  background: rgba(255, 255, 255, 0.01);
}

.drop-zone:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.drop-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 40px var(--accent-glow), inset 0 0 40px rgba(124, 124, 248, 0.03);
  transform: scale(1.012);
}

.drop-zone-icon {
  font-size: 2.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  transition: all 0.35s var(--ease-out);
}

.drop-zone.dragover .drop-zone-icon,
.drop-zone:hover .drop-zone-icon {
  color: var(--accent);
  transform: translateY(-4px) scale(1.05);
}

.drop-zone-text {
  color: var(--text-tertiary);
  font-size: 0.9rem;
  font-weight: 500;
}

.drop-zone-text span {
  color: var(--accent);
  font-weight: 600;
}

.drop-zone-hint {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 0.5rem;
  opacity: 0.5;
}

.drop-zone .form-control {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-zone .file-selected {
  display: none;
  margin-top: 1.25rem;
  padding: 0.6rem 1rem;
  background: var(--accent-soft);
  border: 1px solid rgba(124, 124, 248, 0.15);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  animation: fadeInUp 0.3s var(--ease-out);
}

.drop-zone .file-selected i { margin-right: 0.5rem; }
.file-size-badge {
  display: inline-block;
  font-size: 0.7rem;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  margin-left: 0.4rem;
  font-weight: 600;
}

.drop-zone.has-file {
  border-color: var(--accent);
  border-style: solid;
  background: var(--accent-soft);
}

.drop-zone.has-file .drop-zone-icon,
.drop-zone.has-file .drop-zone-text,
.drop-zone.has-file .drop-zone-hint { display: none; }

.drop-zone.has-file .file-selected { display: flex; align-items: center; }

/* ─── Upload Progress ─── */

.upload-progress {
  display: none;
  margin-top: 1.25rem;
  animation: slideDown 0.3s var(--ease-out);
}

.upload-progress.active { display: block; }

.progress-bar-track {
  width: 100%;
  height: 4px;
  background: var(--border-subtle);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #a78bfa);
  border-radius: 2px;
  transition: width 0.4s var(--ease-out);
  animation: progressPulse 1.5s ease-in-out infinite;
}

.progress-status {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

.progress-status .progress-file { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }

.progress-phase {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  min-height: 1.2em;
}

.upload-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
}

.upload-footer .btn { min-width: 140px; }

.security-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.security-hint i { color: var(--success); font-size: 0.7rem; }

/* ─── Buttons ─── */

.btn {
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.55rem 1.4rem;
  transition: all 0.25s var(--ease-out);
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background 0.2s ease;
}

.btn:hover::after { background: rgba(255, 255, 255, 0.04); }
.btn:active::after { background: rgba(255, 255, 255, 0.08); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #9494f8);
  color: #fff;
  box-shadow: 0 2px 16px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--accent-glow);
}

.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  background: #3a3a5a;
  transform: none;
  box-shadow: none;
  cursor: not-allowed;
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-medium);
  color: var(--text-primary);
  transform: translateY(-1px);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-tertiary);
  padding: 0.4rem 0.75rem;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.8rem; }
.btn-icon { padding: 0.45rem; min-width: unset; }

/* ─── Form Controls ─── */

.form-group { margin-bottom: 0; }
.form-group label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
  display: block;
}

.form-control {
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  background-color: rgba(20, 20, 50, 0.6);
  transition: all 0.25s var(--ease-out);
  color: var(--text-primary) !important;
  width: 100%;
}

.form-control:hover { background-color: rgba(30, 30, 60, 0.7); }

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background-color: rgba(25, 25, 55, 0.8);
  outline: none;
}

.form-control::placeholder { color: var(--text-muted); opacity: 0.5; }

.auth-card .form-control {
  background-color: rgba(15, 15, 35, 0.7);
  border-color: rgba(255, 255, 255, 0.08);
}

.auth-card .form-control:focus {
  background-color: rgba(25, 25, 55, 0.9);
}

/* ─── Files Toolbar ─── */

.files-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.files-toolbar .search-bar {
  flex: 1;
  min-width: 200px;
  margin-bottom: 0;
}

.files-toolbar .search-bar .form-control {
  padding-left: 2.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236868a0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cpath d='m21 21-4.3-4.3'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0.85rem center;
  transition: all 0.3s var(--ease-out);
}

.files-toolbar .search-bar .form-control:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237c7cf8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cpath d='m21 21-4.3-4.3'%3E%3C/path%3E%3C/svg%3E");
}

.toolbar-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* ─── File Cards Grid ─── */

.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.file-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-faint);
  display: flex;
  flex-direction: column;
  transition: all 0.3s var(--ease-out);
  position: relative;
  animation: fadeInUp 0.4s var(--ease-out) forwards;
  opacity: 0;
  overflow: hidden;
}

.file-card:nth-child(1) { animation-delay: 0.03s; }
.file-card:nth-child(2) { animation-delay: 0.06s; }
.file-card:nth-child(3) { animation-delay: 0.09s; }
.file-card:nth-child(4) { animation-delay: 0.12s; }
.file-card:nth-child(5) { animation-delay: 0.15s; }
.file-card:nth-child(6) { animation-delay: 0.18s; }
.file-card:nth-child(7) { animation-delay: 0.21s; }
.file-card:nth-child(8) { animation-delay: 0.24s; }
.file-card:nth-child(9) { animation-delay: 0.27s; }
.file-card:nth-child(n+10) { animation-delay: 0.30s; }

.file-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(124, 124, 248, 0.06);
  transform: translateY(-3px);
}

.file-card-accent {
  height: 3px;
  background: linear-gradient(90deg, var(--file-color, var(--accent)), rgba(124, 124, 248, 0.3));
  flex-shrink: 0;
}

.file-card-top {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.1rem 1.1rem 0.5rem;
}

.file-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(124, 124, 248, 0.12), rgba(124, 124, 248, 0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: var(--file-color, var(--accent));
  flex-shrink: 0;
  transition: all 0.3s var(--ease-out);
}

.file-card:hover .file-icon-wrap {
  background: linear-gradient(135deg, rgba(124, 124, 248, 0.18), rgba(124, 124, 248, 0.08));
  transform: scale(1.05);
}

.file-card-body {
  flex: 1;
  min-width: 0;
}

.file-card-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}

.file-card-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.meta-sep {
  opacity: 0.3;
  font-size: 0.6rem;
}

.file-card-menu {
  flex-shrink: 0;
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.file-card-menu .delete-link,
.file-card-menu .file-card-share,
.file-card-menu .file-card-shared {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.75rem;
  transition: all 0.2s ease;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.file-card-menu .file-card-shared {
  color: #34d399;
  cursor: pointer;
}

.file-card-menu .delete-link:hover {
  background: var(--error-bg);
  color: var(--error) !important;
}

.file-card-menu .file-card-share:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.file-card-actions {
  padding: 0.6rem 1.1rem 1.1rem;
}

.btn-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--file-color, var(--accent));
  background: rgba(124, 124, 248, 0.06);
  border: 1px solid rgba(124, 124, 248, 0.1);
  text-decoration: none;
  transition: all 0.25s var(--ease-out);
  cursor: pointer;
}

.btn-download i {
  font-size: 0.7rem;
}

.btn-download:hover {
  background: rgba(124, 124, 248, 0.12);
  border-color: rgba(124, 124, 248, 0.2);
  color: var(--file-color, var(--accent-hover));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 124, 248, 0.12);
}

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

/* ─── Checkbox ─── */

input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 4px;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  accent-color: var(--accent);
  background: transparent;
  transition: all 0.2s ease;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

input[type="checkbox"]:hover { border-color: var(--accent); }

/* ─── Empty State ─── */

.empty-state {
  text-align: center;
  padding: 4.5rem 2rem;
  color: var(--text-muted);
  animation: fadeIn 0.6s ease;
}

.empty-state i {
  font-size: 3.5rem;
  margin-bottom: 1.25rem;
  opacity: 0.2;
  color: var(--accent);
}

.empty-state p { font-size: 1rem; font-weight: 600; color: var(--text-tertiary); }

.empty-state .empty-sub {
  font-size: 0.85rem;
  margin-top: 0.4rem;
  opacity: 0.5;
}

/* ─── Toast Container ─── */

.toast-container {
  position: fixed;
  bottom: 1.25rem;
  left: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.6rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  animation: toastSlideIn 0.4s var(--ease-spring);
  min-width: 320px;
  max-width: 440px;
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
}

.toast.toast-out { animation: toastSlideOut 0.3s var(--ease-in) forwards; }

.toast-icon { font-size: 1.1rem; flex-shrink: 0; }

.toast-message { flex: 1; }

.toast-close {
  background: none;
  border: none;
  color: inherit;
  opacity: 0.4;
  cursor: pointer;
  padding: 0.1rem;
  font-size: 1.1rem;
  line-height: 1;
  transition: opacity 0.2s ease;
}

.toast-close:hover { opacity: 0.8; }

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 2px 2px 0;
  animation: toastProgress 4s linear forwards;
}

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

.toast-success {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  border-color: var(--success-border);
}

.toast-success .toast-progress { background: var(--success); }

.toast-error {
  background: var(--error-bg);
  color: var(--error);
  border-color: var(--error-border);
}

.toast-error .toast-progress { background: var(--error); }

/* ─── Modal ─── */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 9998;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

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

.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  border: 1px solid var(--border-subtle);
  animation: scaleIn 0.3s var(--ease-spring);
}

.modal-box h3 {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.modal-box p {
  color: var(--text-tertiary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  gap: 0.65rem;
  justify-content: flex-end;
}

.modal-actions .btn { min-width: 80px; justify-content: center; }

/* ─── Section Divider ─── */

.section-divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
  margin: 0 0 2rem 0;
}

/* ─── Section Header ─── */

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

.section-header h2 { margin-bottom: 0; }

.section-header .file-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ─── Processing Banner ─── */

.processing-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  margin-bottom: 1rem;
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.25);
  border-radius: 8px;
  font-size: 0.85rem;
  color: #34d399;
  animation: fadeIn 0.3s ease;
}

.processing-banner .processing-refresh {
  margin-left: auto;
  font-size: 0.75rem;
  opacity: 0.7;
  white-space: nowrap;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Filter Toggle ─── */

.filter-toggle {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.7rem;
  user-select: none;
  margin-left: 0.2rem;
  opacity: 0.3;
  transition: all 0.2s ease;
}

.filter-toggle:hover { opacity: 1; color: var(--accent); }

/* ─── Spinner ─── */

.spinner {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.spinner-sm { width: 0.85rem; height: 0.85rem; border-width: 1.5px; }

/* ─── Responsive ─── */

@media (max-width: 768px) {
  .container { padding-left: 1rem; padding-right: 1rem; padding-top: calc(56px + 1rem); }

  h1 { font-size: 1.35rem; }
  h2 { font-size: 1.05rem; }



  .files-toolbar { flex-direction: column; gap: 0.75rem; align-items: stretch; }
  .files-toolbar .search-bar { min-width: unset; }
  .toolbar-actions { justify-content: center; }
  .files-grid { grid-template-columns: 1fr; gap: 0.75rem; }

  .btn { font-size: 0.8rem; padding: 0.45rem 1rem; }
  .card-upload { padding: 1.25rem; }
  .auth-card { padding: 2rem 1.5rem; margin: 0 0.5rem; }
  .drop-zone { padding: 1.75rem 1rem; }
  .drop-zone-icon { font-size: 2.2rem; }

  .upload-footer { flex-direction: column; gap: 0.75rem; align-items: stretch; }
  .upload-footer .btn { width: 100%; min-width: unset; }

  .toast { min-width: unset; width: calc(100vw - 2rem); }
  .toast-container { right: 0.5rem; left: 0.5rem; top: 0.75rem; }

  .section-header { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
}

@media (max-width: 576px) {
  .files-grid { grid-template-columns: 1fr; }
}


