/* ============================================================
   Sendly — Design System
   Dark moderne avec glassmorphism
   ============================================================ */

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

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

:root {
  --bg-primary:    #0d0d1a;
  --bg-secondary:  #12122a;
  --bg-tertiary:   #1a1a3a;

  --accent-1:      #7c3aed;
  --accent-2:      #4f46e5;
  --accent-3:      #06b6d4;
  --accent-grad:   linear-gradient(135deg, #7c3aed, #4f46e5);
  --accent-grad2:  linear-gradient(135deg, #4f46e5, #06b6d4);

  --glass-bg:      rgba(255, 255, 255, 0.04);
  --glass-border:  rgba(255, 255, 255, 0.08);
  --glass-hover:   rgba(255, 255, 255, 0.07);

  --text-primary:  #f1f5f9;
  --text-secondary:#94a3b8;
  --text-muted:    #64748b;

  --success:       #10b981;
  --error:         #ef4444;
  --warning:       #f59e0b;

  --radius-sm:     8px;
  --radius-md:     16px;
  --radius-lg:     24px;
  --radius-xl:     32px;

  --shadow-card:   0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow:   0 0 40px rgba(124, 58, 237, 0.15);

  --transition:    all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* ── Fond animé ────────────────────────────────────────────── */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  isolation: isolate;
}

/* Orbes de fond */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  animation: floatOrb 20s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

.orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #7c3aed, transparent 70%);
  top: -200px;
  left: -200px;
  animation-delay: 0s;
}

.orb-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #4f46e5, transparent 70%);
  bottom: -150px;
  right: -100px;
  animation-delay: -7s;
  animation-duration: 25s;
}

.orb-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #06b6d4, transparent 70%);
  top: 40%;
  left: 60%;
  animation-delay: -14s;
  animation-duration: 18s;
  opacity: 0.12;
}

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(30px, -40px) scale(1.05); }
  66%       { transform: translate(-20px, 30px) scale(0.95); }
}

/* ── Header ────────────────────────────────────────────────── */
.header {
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  width: 36px;
  height: 36px;
}

.logo-text {
  font-size: 1.4rem;
  font-weight: 800;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.nav-badge {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 100px;
  backdrop-filter: blur(10px);
}

/* ── Main ──────────────────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

/* ── Carte principale ──────────────────────────────────────── */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow-card), var(--shadow-glow);
  padding: 40px;
  width: 100%;
  max-width: 560px;
  transition: var(--transition);
}

/* ── Hero text ─────────────────────────────────────────────── */
.hero-text {
  text-align: center;
  margin-bottom: 32px;
}

.hero-text h1 {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 40%, var(--accent-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.hero-text p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ── Zone de dépôt ─────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed rgba(124, 58, 237, 0.35);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: rgba(124, 58, 237, 0.03);
  position: relative;
  user-select: none;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--accent-1);
  background: rgba(124, 58, 237, 0.08);
  transform: scale(1.005);
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.1);
}

.drop-zone.dragover {
  border-color: var(--accent-3);
  background: rgba(6, 182, 212, 0.06);
}

.drop-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: var(--accent-grad);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.3);
  transition: var(--transition);
}

.drop-zone:hover .drop-icon {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(124, 58, 237, 0.4);
}

.drop-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.drop-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 18px;
}

/* ── Bouton choisir fichier ─────────────────────────────────── */
.btn-select {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn-select:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.2);
}

/* ── Liste de fichiers ajoutés ─────────────────────────────── */
.file-list-section {
  margin-top: 20px;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--glass-border) transparent;
}

.file-list::-webkit-scrollbar {
  width: 4px;
}
.file-list::-webkit-scrollbar-track { background: transparent; }
.file-list::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 2px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition: var(--transition);
  animation: slideIn 0.2s ease;
}

.file-item:hover {
  background: var(--glass-hover);
}

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

.file-type-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  background: rgba(124, 58, 237, 0.1);
}

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

.file-name {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.btn-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
}

.btn-remove:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
}

.add-more-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px dashed var(--glass-border);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-top: 10px;
  transition: var(--transition);
  width: 100%;
  justify-content: center;
}

.add-more-btn:hover {
  border-color: rgba(255,255,255,0.2);
  color: var(--text-primary);
  background: var(--glass-bg);
}

/* ── Boutons principaux ─────────────────────────────────────── */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--accent-grad);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  margin-top: 20px;
  transition: var(--transition);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.4);
  filter: brightness(1.05);
}

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

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 11px 24px;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
}

/* ── Section upload en cours ───────────────────────────────── */
.progress-container {
  text-align: center;
  padding: 20px 0;
}

.upload-animation {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  position: relative;
}

.upload-animation .ring {
  width: 80px;
  height: 80px;
  border: 3px solid var(--glass-border);
  border-top-color: var(--accent-1);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  position: absolute;
  top: 0;
  left: 0;
}

.upload-animation .ring-inner {
  width: 56px;
  height: 56px;
  border: 3px solid var(--glass-border);
  border-bottom-color: var(--accent-3);
  border-radius: 50%;
  animation: spin 1.5s linear infinite reverse;
  position: absolute;
  top: 12px;
  left: 12px;
}

.upload-animation .arrow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: bounce 1s ease-in-out infinite;
}

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

@keyframes bounce {
  0%, 100% { transform: translate(-50%, -50%); }
  50%       { transform: translate(-50%, calc(-50% - 4px)); }
}

.progress-container h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.current-filename {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-track {
  height: 6px;
  background: var(--glass-border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-bar {
  height: 100%;
  background: var(--accent-grad);
  border-radius: 3px;
  transition: width 0.3s ease;
  position: relative;
  overflow: hidden;
}

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

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

.progress-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.progress-percent {
  font-weight: 600;
  color: var(--accent-1);
}

/* ── Section succès ─────────────────────────────────────────── */
.success-container {
  text-align: center;
  padding: 10px 0;
}

.success-icon-wrap {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.05));
  border: 2px solid rgba(16, 185, 129, 0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  animation: successPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.success-container h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #fff 40%, var(--success));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.success-container > p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.share-box {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  background: var(--bg-primary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 4px 4px 4px 14px;
  align-items: center;
}

.share-url-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-copy {
  background: var(--accent-grad);
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-copy:hover {
  filter: brightness(1.1);
}

.btn-copy.copied {
  background: linear-gradient(135deg, #10b981, #059669);
}

.expiry-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--warning);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 24px;
}

/* ── Section erreur ─────────────────────────────────────────── */
.error-container {
  text-align: center;
  padding: 10px 0;
}

.error-icon-wrap {
  width: 72px;
  height: 72px;
  background: rgba(239, 68, 68, 0.1);
  border: 2px solid rgba(239, 68, 68, 0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.error-container h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--error);
  margin-bottom: 8px;
}

.error-message {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 24px;
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  text-align: left;
}

/* ── Page Share (téléchargement) ───────────────────────────── */
.share-page .card {
  max-width: 580px;
}

.transfer-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--glass-border);
}

.transfer-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: 10px;
}

.transfer-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 5px 12px;
  border-radius: 100px;
}

.meta-chip.warning {
  color: var(--warning);
  background: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.2);
}

.download-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.download-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: var(--transition);
}

.download-item:hover {
  border-color: rgba(124, 58, 237, 0.25);
  background: var(--glass-hover);
}

.download-item .file-type-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  font-size: 1.3rem;
}

.download-item .file-meta {
  flex: 1;
  min-width: 0;
}

.download-item .file-name {
  font-size: 0.9rem;
}

.btn-download-single {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-grad);
  color: #fff;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: var(--transition);
  flex-shrink: 0;
  white-space: nowrap;
}

.btn-download-single:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35);
}

.download-all-section {
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.download-all-section .btn-primary {
  margin-top: 0;
  flex: 1;
  min-width: 200px;
}

/* Page expirée */
.expired-card {
  text-align: center;
  padding: 20px 0;
}

.expired-icon-wrap {
  font-size: 3.5rem;
  margin-bottom: 20px;
  display: block;
  animation: pulse 2s ease infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.05); }
}

.expired-card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.expired-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 28px;
}

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer a:hover {
  color: var(--text-secondary);
}

/* ── Utilitaires ─────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .header {
    padding: 16px 20px;
  }

  .card {
    padding: 28px 20px;
    border-radius: var(--radius-lg);
  }

  .hero-text h1 {
    font-size: 1.5rem;
  }

  .drop-zone {
    padding: 36px 16px;
  }

  .download-all-section {
    flex-direction: column;
  }

  .transfer-meta {
    gap: 8px;
  }
}
