/* ─────────────────────────────────────────────────────────────────────────────
   File-Du — Global Stylesheet
   Design: Deep Space Glassmorphism | Purple/Indigo accent
   ───────────────────────────────────────────────────────────────────────────── */

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

/* ═══════════════════════════════════════════════════════════════════════════
   CSS CUSTOM PROPERTIES — DARK THEME (default)
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  /* Brand */
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-rgb: 99, 102, 241;
  --secondary: #8b5cf6;
  --accent: #06b6d4;

  /* Backgrounds */
  --bg-body: #080818;
  --bg-surface: #0e0e24;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --bg-input: rgba(255, 255, 255, 0.06);
  --bg-input-focus: rgba(255, 255, 255, 0.09);

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --text-accent: #818cf8;

  /* Borders */
  --border: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(99, 102, 241, 0.4);
  --border-focus: rgba(99, 102, 241, 0.7);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.6);
  --glow: 0 0 20px rgba(99, 102, 241, 0.25);
  --glow-strong: 0 0 40px rgba(99, 102, 241, 0.4);

  /* UI */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --blur: blur(20px);
  --blur-lg: blur(40px);

  /* Transitions */
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  /* Status */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --info: #06b6d4;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LIGHT THEME
   ═══════════════════════════════════════════════════════════════════════════ */
[data-theme='light'] {
  --bg-body: #f0f2ff;
  --bg-surface: #e8eaf6;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --bg-input: rgba(255, 255, 255, 0.9);
  --bg-input-focus: #ffffff;

  --text-primary: #1e1b4b;
  --text-secondary: #4338ca;
  --text-muted: #6366f1;
  --text-accent: #4f46e5;

  --border: rgba(99, 102, 241, 0.15);
  --border-accent: rgba(99, 102, 241, 0.4);
  --border-focus: rgba(99, 102, 241, 0.7);

  --shadow-sm: 0 2px 8px rgba(99, 102, 241, 0.1);
  --shadow-md: 0 4px 24px rgba(99, 102, 241, 0.15);
  --shadow-lg: 0 8px 48px rgba(99, 102, 241, 0.2);
  --glow: 0 0 20px rgba(99, 102, 241, 0.15);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family:
    'Inter',
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition:
    background var(--transition),
    color var(--transition);
  overflow-x: hidden;
}

/* Subtle animated background gradient */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(99, 102, 241, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

[data-theme='light'] body::before {
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 60%);
}

#app {
  position: relative;
  z-index: 1;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  color: var(--secondary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════════════════════════════════════ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 8, 24, 0.8);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--border);
}

[data-theme='light'] .navbar {
  background: rgba(240, 242, 255, 0.85);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo-icon {
  font-size: 1.4rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
  background: none;
  border: none;
  font-family: inherit;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.nav-link.active {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: 600;
}

.icon-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-accent);
  box-shadow: var(--glow);
}

.lang-btn {
  width: auto;
  padding: 0 0.75rem;
  font-size: 0.8rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   HAMBURGER & MOBILE NAV
   ═══════════════════════════════════════════════════════════════════════════ */
.hamburger-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  align-items: center;
  justify-content: center;
  margin-left: auto;
}

.hamburger-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-accent);
}

.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  top: 64px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99;
  animation: fadeIn 0.2s ease;
}

.mobile-menu {
  position: fixed;
  top: 64px;
  right: 0;
  width: 280px;
  max-width: calc(100vw - 2rem);
  max-height: calc(100vh - 80px);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 0 0 0 var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  animation: slideInMenu 0.25s ease;
  overflow-y: auto;
}

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

.mobile-menu-section {
  padding: 0.5rem;
}

.mobile-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 0.5rem 1rem;
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.mobile-menu-item:hover,
.mobile-menu-item.active {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.mobile-menu-item.active {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.1);
}

.mobile-menu-action {
  gap: 0.75rem;
}

.mobile-menu-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.mobile-menu-logout {
  color: var(--danger);
}

.mobile-menu-logout:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* Mobile Admin Tabs */
.mobile-admin-tabs {
  display: none;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.mobile-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.mobile-tab:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.mobile-tab.active {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.15);
  box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.3);
}

/* Visibility utilities */
.mobile-nav {
  display: none;
}
.desktop-nav {
  display: flex;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */
.main {
  min-height: calc(100vh - 64px);
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════════════════════════════════════ */
.hero {
  padding: 4rem 1.5rem 2rem;
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.hero-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
}

.hero-sub {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CARD
   ═══════════════════════════════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow-md);
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}

.transfer-card {
  padding: 0;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TAB BAR
   ═══════════════════════════════════════════════════════════════════════════ */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0.5rem 0;
  gap: 0.25rem;
}

.tab {
  flex: 1;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.tab:hover {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.tab.active {
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.08);
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px 2px 0 0;
}

.tab-content {
  padding: 2rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   UPLOAD ZONE
   ═══════════════════════════════════════════════════════════════════════════ */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.upload-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.03), rgba(139, 92, 246, 0.03));
  opacity: 0;
  transition: opacity var(--transition);
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--primary);
  box-shadow: var(--glow);
}

.upload-zone:hover::before,
.upload-zone.drag-over::before {
  opacity: 1;
}

.upload-zone.drag-over {
  border-style: solid;
  border-color: var(--secondary);
  box-shadow: var(--glow-strong);
  background: rgba(var(--primary-rgb), 0.05);
}

.upload-zone-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  pointer-events: none;
}

.upload-icon {
  color: var(--primary);
  opacity: 0.8;
  transition:
    transform var(--transition),
    opacity var(--transition);
}

.upload-zone:hover .upload-icon,
.upload-zone.drag-over .upload-icon {
  transform: translateY(-4px) scale(1.1);
  opacity: 1;
}

.upload-text {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
}

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

.upload-zone .upload-zone-content > .btn-primary {
  pointer-events: auto;
}

/* ═══════════════════════════════════════════════════════════════════════════
   REMOTE DOWNLOAD FORM
   ═══════════════════════════════════════════════════════════════════════════ */
.remote-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.input-group {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}

.url-input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.url-input {
  width: 100%;
  padding: 0.75rem 5rem 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: all var(--transition);
  outline: none;
}

.url-input:focus {
  border-color: var(--border-focus);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

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

.url-type-badge {
  position: absolute;
  right: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: var(--bg-card-hover);
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.url-type-badge.type-http {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent);
  border-color: rgba(6, 182, 212, 0.3);
}
.url-type-badge.type-magnet {
  background: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
  border-color: rgba(139, 92, 246, 0.4);
}
.url-type-badge.type-torrent {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.3);
}

.remote-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.5);
  color: #fff;
}

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

.btn-primary.btn-large {
  padding: 1rem 2.5rem;
  font-size: 1.05rem;
}

.btn-primary.btn-full {
  width: 100%;
  justify-content: center;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-outline:hover {
  border-color: var(--border-accent);
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--danger);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

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

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

/* ═══════════════════════════════════════════════════════════════════════════
   INPUT / SELECT
   ═══════════════════════════════════════════════════════════════════════════ */
.input {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
  transition: all var(--transition);
  outline: none;
}

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

.select {
  padding: 0.55rem 0.9rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  outline: none;
  transition: all var(--transition);
}

.select:focus {
  border-color: var(--border-focus);
}

/* ═══════════════════════════════════════════════════════════════════════════
   TRANSFER / PROGRESS CARDS
   ═══════════════════════════════════════════════════════════════════════════ */
.active-transfers {
  margin-top: 2rem;
}

.section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.transfers-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tx-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  transition: border-color var(--transition);
  animation: slideIn 0.25s ease;
}

.tx-card.done {
  border-color: rgba(16, 185, 129, 0.3);
}
.tx-card.error {
  border-color: rgba(239, 68, 68, 0.3);
}

.tx-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.tx-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tx-type-badge {
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: rgba(var(--primary-rgb), 0.15);
  color: var(--text-accent);
  border: 1px solid rgba(var(--primary-rgb), 0.25);
  flex-shrink: 0;
}

.tx-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 400px;
}

.tx-size {
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.close-btn {
  width: 24px;
  height: 24px;
  min-width: 24px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-family: inherit;
}

.close-btn:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

/* Progress bar */
.progress-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.progress-bar {
  height: 6px;
  background: var(--bg-input);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 99px;
  transition: width 0.3s ease;
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 1.5s infinite;
}

.progress-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Done state */
.tx-done {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.share-link-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.share-link-input {
  flex: 1;
  padding: 0.45rem 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-family: monospace;
  outline: none;
  min-width: 0;
}

.tx-error {
  font-size: 0.825rem;
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   PAGE HEADER
   ═══════════════════════════════════════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FILES TOOLBAR
   ═══════════════════════════════════════════════════════════════════════════ */
.files-toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.search-wrapper {
  flex: 1;
  min-width: 200px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
}

.search-input {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.4rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.875rem;
  outline: none;
  transition: all var(--transition);
}

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

.sort-options {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.sort-options label {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FILE LIST
   ═══════════════════════════════════════════════════════════════════════════ */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
  animation: slideIn 0.2s ease;
}

.file-item:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-sm);
  transform: translateX(2px);
}

.file-icon {
  flex-shrink: 0;
  display: flex;
}

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

.file-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}

.file-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.file-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}

.files-footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════
   EMPTY / LOADING STATES
   ═══════════════════════════════════════════════════════════════════════════ */
.empty-state,
.loading,
.error-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.empty-icon {
  margin: 0 auto 1rem;
  opacity: 0.4;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════════════════════ */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
  text-align: center;
}

.login-icon {
  color: var(--primary);
  margin: 0 auto 1.5rem;
  opacity: 0.9;
}

.login-card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.login-card p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.form-error {
  font-size: 0.825rem;
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SHARE PAGE
   ═══════════════════════════════════════════════════════════════════════════ */
.share-container {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 4rem;
}

.share-card {
  width: 100%;
  max-width: 520px;
  padding: 2.5rem;
  text-align: center;
}

.share-file-icon {
  margin: 0 auto 1.25rem;
  display: flex;
  justify-content: center;
  font-size: 3.5rem;
}

.share-filename {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  word-break: break-all;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.share-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 2rem;
  text-align: left;
}

.share-meta-item {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.9rem;
}

.meta-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.meta-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-all;
}

.share-card.not-found {
  border-color: rgba(239, 68, 68, 0.2);
}

.share-icon {
  margin: 0 auto 1.25rem;
  opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: fadeIn 0.15s ease;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 440px;
  animation: scaleIn 0.2s ease;
  overflow: hidden;
}

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

.modal-title {
  font-size: 1rem;
  font-weight: 600;
}

.modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

/* ═══════════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: 80px;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  color: var(--text-primary);
  max-width: 360px;
  pointer-events: auto;
  transform: translateX(calc(100% + 2rem));
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.toast-show {
  transform: translateX(0);
  opacity: 1;
}

.toast-success {
  border-color: rgba(16, 185, 129, 0.3);
}
.toast-error {
  border-color: rgba(239, 68, 68, 0.3);
}
.toast-warning {
  border-color: rgba(245, 158, 11, 0.3);
}

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.toast-success .toast-icon {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}
.toast-error .toast-icon {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}
.toast-warning .toast-icon {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}
.toast-info .toast-icon {
  background: rgba(6, 182, 212, 0.15);
  color: var(--info);
}

.toast-message {
  flex: 1;
}

.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0;
  line-height: 1;
  font-family: inherit;
  transition: color var(--transition);
}

.toast-close:hover {
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */
@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(200%);
  }
}

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

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

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

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

.shake {
  animation: shake 0.4s ease;
}

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

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .hamburger-btn {
    display: flex;
  }
  .desktop-nav {
    display: none !important;
  }
  .mobile-nav {
    display: flex;
  }
  .mobile-admin-tabs {
    display: flex;
  }

  .admin-panel-card .tab-content {
    padding: 1.5rem 1rem;
  }

  .nav-links {
    display: none;
  }
  .nav-actions {
    display: none;
  }

  .nav-container {
    padding: 0 1rem;
  }
  .container {
    padding: 1.5rem 1rem 3rem;
  }
  .hero {
    padding: 2.5rem 1rem 1.5rem;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .upload-zone {
    padding: 2rem 1rem;
  }
  .input-group {
    flex-direction: column;
  }
  .url-input {
    padding-right: 1rem;
  }
  .url-type-badge {
    display: none;
  }

  .share-meta {
    grid-template-columns: 1fr;
  }

  .file-item {
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
  }
  .file-info {
    width: 100%;
    order: 2;
    margin-top: 0.5rem;
  }
  .file-icon {
    order: 1;
  }
  .file-actions {
    width: 100%;
    order: 3;
    margin-top: 0.5rem;
    justify-content: flex-start;
    gap: 0.5rem;
  }

  .files-toolbar {
    flex-direction: column;
    gap: 0.75rem;
  }
  .search-wrapper {
    min-width: 100%;
    width: 100%;
  }
  .sort-options {
    width: 100%;
    flex-wrap: wrap;
  }

  .tx-info {
    flex-wrap: wrap;
  }
  .tx-name {
    max-width: 100%;
  }

  .modal {
    max-width: 100%;
    border-radius: var(--radius);
  }
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 1rem;
  }

  .toast {
    max-width: calc(100vw - 2rem);
  }
  .toast-container {
    right: 1rem;
    top: 72px;
  }
}

@media (max-width: 640px) {
  .mobile-menu {
    width: calc(100vw - 1rem);
    max-width: none;
  }
  .mobile-tab {
    font-size: 0.8rem;
    padding: 0.6rem 0.4rem;
  }
}
