/* ================================================================
   CORFACE — Cortador Viral de Reels
   Design: Dark Glassmorphism + Neon Accents
================================================================ */

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

:root {
  --bg-base:       #080c14;
  --bg-card:       rgba(255,255,255,0.04);
  --bg-card-hover: rgba(255,255,255,0.07);
  --border:        rgba(255,255,255,0.08);
  --border-glow:   rgba(168,85,247,0.4);
  --accent:        #a855f7;
  --accent-2:      #06b6d4;
  --accent-green:  #10b981;
  --accent-pink:   #f43f5e;
  --accent-orange: #f97316;
  --text-primary:  #f1f5f9;
  --text-secondary:#94a3b8;
  --text-muted:    #475569;
  --radius-sm:     8px;
  --radius-md:     12px;
  --radius-lg:     18px;
  --radius-xl:     24px;
  --shadow-card:   0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow:   0 0 30px rgba(168,85,247,0.25);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Background animated gradient ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 15% 20%, rgba(168,85,247,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 85% 70%, rgba(6,182,212,0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ══════════════════════════════════════
   HEADER
══════════════════════════════════════ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8,12,20,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-icon { font-size: 24px; }
.logo-text {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-primary);
}
.logo-text .accent {
  background: linear-gradient(135deg, #a855f7, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-badge {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}
.header-sub {
  color: var(--text-muted);
  font-size: 13px;
  margin-left: auto;
}

/* ══════════════════════════════════════
   MAIN GRID
══════════════════════════════════════ */
.main-grid {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 20px;
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 24px;
  align-items: start;
}

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

/* ══════════════════════════════════════
   PANEL / CARDS
══════════════════════════════════════ */
.panel { display: flex; flex-direction: column; gap: 16px; }

.step-card, .card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
  transition: border-color 0.3s;
}
.step-card:hover { border-color: rgba(168,85,247,0.2); }

.step-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.step-num {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(168,85,247,0.5);
}
.step-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ── Drop Zone ── */
.drop-zone {
  border: 2px dashed rgba(168,85,247,0.35);
  border-radius: var(--radius-lg);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(168,85,247,0.03);
}
.drop-zone:hover, .drop-zone.dragging {
  border-color: var(--accent);
  background: rgba(168,85,247,0.08);
  box-shadow: 0 0 20px rgba(168,85,247,0.15);
}
.drop-icon { font-size: 40px; margin-bottom: 10px; }
.drop-text { font-size: 15px; font-weight: 600; color: var(--text-secondary); line-height: 1.5; }
.drop-sub { font-size: 13px; font-weight: 400; color: var(--text-muted); }

/* ── Video Info ── */
.video-info {
  margin-top: 14px;
  background: rgba(16,185,129,0.06);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.vi-row { display: flex; gap: 8px; align-items: center; }
.vi-label { font-size: 12px; color: var(--text-muted); min-width: 90px; }
.vi-val { font-size: 13px; font-weight: 600; color: var(--accent-green); word-break: break-all; }

/* ── Form ── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  letter-spacing: 0.3px;
}
.form-input, .form-textarea {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  transition: border-color 0.25s, box-shadow 0.25s;
  resize: vertical;
}
.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.15);
}
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 5px; }
.form-input-unit { font-size: 12px; color: var(--text-muted); }

.char-counter { text-align: right; font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── Duration Pills ── */
.duration-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.pill {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.pill.active {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 12px rgba(168,85,247,0.4);
}
.custom-duration-row {
  display: flex; align-items: center; gap: 8px; margin-top: 8px;
}
.custom-duration-row .form-input { width: 100px; }

/* ── Platform Grid ── */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.platform-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
}
.platform-btn:hover {
  border-color: var(--accent);
  background: rgba(168,85,247,0.06);
}
.platform-btn.active {
  border-color: var(--accent);
  background: rgba(168,85,247,0.12);
  color: var(--text-primary);
  box-shadow: 0 0 10px rgba(168,85,247,0.2);
}
.plat-icon { font-size: 20px; }
.plat-name { font-size: 11px; font-weight: 600; text-align: center; }
.plat-ratio { font-size: 10px; color: var(--accent-2); font-weight: 500; }

.ratio-display {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(6,182,212,0.07);
  border: 1px solid rgba(6,182,212,0.2);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 13px;
  color: var(--accent-2);
  font-weight: 600;
}
.ratio-icon { font-size: 18px; }

/* ── Estimates ── */
.clips-preview-count {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(249,115,22,0.07);
  border: 1px solid rgba(249,115,22,0.2);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-orange);
}
.estimate-icon { font-size: 20px; }

/* ── Process Button ── */
.btn-process {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: none;
  background: linear-gradient(135deg, #a855f7, #7c3aed, #06b6d4);
  background-size: 200% 200%;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 20px rgba(168,85,247,0.4);
  animation: gradientShift 3s ease infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-process:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  animation: none;
  background: #334155;
  box-shadow: none;
}
.btn-process:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(168,85,247,0.55);
}
.btn-process:not(:disabled):active { transform: translateY(0); }
.btn-icon { font-size: 18px; }

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── Progress ── */
.progress-area {
  margin-top: 16px;
}
.progress-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.progress-bar-wrap {
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 6px;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #a855f7, #06b6d4);
  border-radius: 999px;
  transition: width 0.4s ease;
  box-shadow: 0 0 10px rgba(168,85,247,0.6);
}
.progress-sub {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

/* ══════════════════════════════════════
   PANEL DERECHO
══════════════════════════════════════ */
.preview-card { margin-bottom: 0; }
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
}
.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}
.video-preview {
  width: 100%;
  border-radius: var(--radius-md);
  background: #000;
  max-height: 280px;
  object-fit: contain;
}

/* ── Download All Button ── */
.btn-download-all {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--accent-green);
  background: rgba(16,185,129,0.08);
  color: var(--accent-green);
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-download-all:hover {
  background: rgba(16,185,129,0.18);
  box-shadow: 0 0 12px rgba(16,185,129,0.3);
}

/* ── Clips Grid ── */
.clips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.clip-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.25s;
  cursor: pointer;
}
.clip-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(168,85,247,0.2);
}
.clip-thumb-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 default */
  background: #0f172a;
  overflow: hidden;
}
.clip-thumb-wrap.vertical { padding-top: 177.78%; } /* 9:16 */
.clip-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.clip-thumb-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, #1e1b4b, #0f172a);
}
.clip-thumb-icon { font-size: 32px; }
.clip-thumb-label {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  padding: 0 8px;
}
.clip-play-overlay {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  background: rgba(0,0,0,0.4);
}
.clip-card:hover .clip-play-overlay { opacity: 1; }
.clip-play-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(168,85,247,0.85);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.clip-info {
  padding: 10px 12px;
}
.clip-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.clip-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.clip-actions { display: flex; gap: 6px; }
.btn-clip-dl {
  flex: 1;
  padding: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(16,185,129,0.3);
  background: rgba(16,185,129,0.08);
  color: var(--accent-green);
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.btn-clip-dl:hover { background: rgba(16,185,129,0.18); }
.btn-clip-preview {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-clip-preview:hover { border-color: var(--accent); color: var(--accent); }

/* ── Placeholder ── */
.placeholder-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 48px 36px;
  text-align: center;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
}
.placeholder-icon { font-size: 60px; margin-bottom: 16px; }
.placeholder-title { font-size: 22px; font-weight: 800; color: var(--text-primary); margin-bottom: 12px; }
.placeholder-desc { font-size: 14px; color: var(--text-secondary); max-width: 380px; margin: 0 auto 24px; line-height: 1.6; }
.placeholder-features { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; max-width: 280px; margin: 0 auto; }
.pf-item { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-secondary); }
.pf-item span { font-size: 18px; }

/* ══════════════════════════════════════
   MODAL
══════════════════════════════════════ */
.modal-overlay {
  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: 20px;
}
.modal-box {
  background: #0f172a;
  border: 1px solid rgba(168,85,247,0.3);
  border-radius: var(--radius-xl);
  padding: 28px;
  max-width: 700px;
  width: 100%;
  position: relative;
  box-shadow: 0 0 60px rgba(168,85,247,0.25);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.modal-close:hover { border-color: var(--accent-pink); color: var(--accent-pink); }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 14px; }
.modal-video { width: 100%; border-radius: var(--radius-md); background: #000; max-height: 450px; }
.modal-meta {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  border: 1px solid var(--border);
}
.modal-actions { margin-top: 14px; }
.btn-modal-download {
  width: 100%;
  padding: 13px;
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-modal-download:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(16,185,129,0.4); }

/* ══════════════════════════════════════
   TOAST
══════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(15,23,42,0.95);
  border: 1px solid rgba(168,85,247,0.4);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 30px rgba(0,0,0,0.5);
  z-index: 999;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(168,85,247,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(168,85,247,0.5); }
