/* Tema Oscuro Premium - Vuela.ai UGC Studio */
:root {
  --bg-color: #000000; 
  --card-bg: rgba(13, 13, 13, 0.75);
  --card-border: rgba(255, 255, 255, 0.05);
  
  --text-main: #ffffff;
  --text-muted: #a1a1aa;
  
  --primary: #9333ea;
  --primary-hover: #a855f7;
  --primary-gradient: linear-gradient(135deg, #d946ef, #9333ea, #4f46e5);
  
  --secondary: rgba(255, 255, 255, 0.05);
  --secondary-hover: rgba(255, 255, 255, 0.1);
  --secondary-text: #e2e8f0;
  
  --accent: #f43f5e;
  --input-bg: rgba(15, 23, 42, 0.6);
  --input-border: rgba(255, 255, 255, 0.12);
  
  --success: #10b981;
  --error: #ef4444;
  
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', 'Inter', system-ui, sans-serif;
  
  --radius-lg: 24px;
  --radius-md: 14px;
  --radius-sm: 8px;
  
  --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.15);
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.4);
  
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Fondos Animados - Aurora Mesh Gradient */
.bg-shape {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  z-index: 0;
  opacity: 0.4;
  animation: float 20s infinite alternate ease-in-out;
  pointer-events: none;
}
.circle-1 { width: 600px; height: 600px; background: radial-gradient(circle, rgba(217, 70, 239, 0.25) 0%, transparent 70%); top: -150px; left: -100px; }
.circle-2 { width: 700px; height: 700px; background: radial-gradient(circle, rgba(79, 70, 229, 0.2) 0%, transparent 70%); bottom: -200px; right: -150px; animation-delay: -5s; }

@keyframes float {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); }
  50% { transform: translate(60px, -40px) scale(1.1) rotate(10deg); }
  100% { transform: translate(-40px, 50px) scale(0.9) rotate(-5deg); }
}

.app-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 600px;
  padding: 20px;
  margin: 40px 0;
}

/* Glass Card Premium */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--card-border);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-glass);
}

.app-header { text-align: center; margin-bottom: 28px; border-bottom: 1px solid var(--card-border); padding-bottom: 24px;}
.brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap;}
.brand-icon { width: 38px; height: 38px; border-radius: 12px; background: var(--primary-gradient); display: flex; align-items: center; justify-content: center; font-size: 16px; color: white; box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4); }
h1 { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -0.5px; color: var(--text-main); }
.gradient-text { background: var(--primary-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-weight: 800; }
.brand-credits { font-size: 13px; color: var(--text-muted); font-weight: 500; margin-left: auto; }
.brand-bold { color: #fff; font-weight: 600;}
.tagline { color: var(--text-muted); font-size: 14px; font-weight: 400; }

/* Vistas */
.view-section { display: none; animation: fadeIn 0.4s ease forwards; }
.view-section.active { display: block; }

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

/* Landing Grid */
.tools-grid { display: flex; flex-direction: column; gap: 16px; margin-top: 24px;}
.tool-card {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  display: block;
  width: 100%;
  color: var(--text-main);
  position: relative;
  overflow: hidden;
}
.tool-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--primary-gradient);
  opacity: 0;
  transition: var(--transition);
  z-index: 0;
}
.tool-card > * { position: relative; z-index: 1; }
.tool-card:hover { 
  border-color: rgba(139, 92, 246, 0.5); 
  transform: translateY(-3px); 
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3), var(--shadow-glow);
  background: rgba(30, 41, 59, 0.6);
}
.tool-icon { font-size: 28px; margin-bottom: 12px; filter: drop-shadow(0 2px 8px rgba(139, 92, 246, 0.3));}
.tool-title { font-size: 18px; font-family: var(--font-display); font-weight: 600; margin-bottom: 8px; }
.tool-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; line-height: 1.5; }
.tool-action { font-size: 13px; font-weight: 600; color: var(--primary-hover); display: flex; align-items: center; gap: 6px; transition: gap 0.2s; }
.tool-card:hover .tool-action { gap: 10px; }
.tool-action i { font-size: 11px; }

/* Form Header */
.form-header { display: flex; align-items: center; margin-bottom: 28px; position: relative;}
.nav-back { position: absolute; left: 0; top: 50%; transform: translateY(-50%); font-weight: 500; font-size: 14px;}
.section-title { font-size: 22px; font-family: var(--font-display); font-weight: 600; width: 100%; text-align: center; }

/* Formularios */
.form-group { margin-bottom: 24px; text-align: left; position: relative;}
.form-row { display: flex; gap: 16px; margin-bottom: 24px; }
.form-row .form-group { margin-bottom: 0; }
.half { flex: 1; min-width: 0; }

label { display: block; font-weight: 500; margin-bottom: 10px; font-size: 13px; color: var(--text-main); letter-spacing: 0.3px;}
label i { color: var(--primary); margin-right: 6px; width: 16px; opacity: 0.8;}

input[type="text"], input[type="url"], textarea, select {
  width: 100%; 
  background: var(--input-bg); 
  border: 1px solid var(--input-border);
  color: var(--text-main); 
  border-radius: var(--radius-md); 
  padding: 14px 16px;
  font-family: var(--font-sans); 
  font-size: 15px; 
  transition: var(--transition);
  backdrop-filter: blur(10px);
}
textarea { resize: vertical; min-height: 100px; line-height: 1.5; }
input:focus, textarea:focus, select:focus { 
  outline: none; 
  border-color: var(--primary); 
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25), inset 0 1px 2px rgba(0,0,0,0.2); 
  background: rgba(30, 41, 59, 0.8);
}
input::placeholder, textarea::placeholder { color: #64748b; }

/* Custom Select */
.select-wrapper { position: relative; }
select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 40px;}
select option { background: #0f172a; color: #fff; }
.select-icon { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--primary); pointer-events: none;}

/* Drop Zone */
.drop-zone { position: relative; background: rgba(15, 23, 42, 0.4); border: 1px dashed var(--text-muted); border-radius: var(--radius-md); padding: 30px 20px; text-align: center; transition: var(--transition); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.drop-zone.dz-small { padding: 16px 12px; height: 120px;}
.drop-zone:hover, .drop-zone.dragover { background: rgba(30, 41, 59, 0.6); border-color: var(--primary); box-shadow: inset 0 0 20px rgba(139,92,246,0.05);}
input[type="file"] { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 10; }
.drop-icon { font-size: 32px; color: var(--primary); margin-bottom: 12px; transition: var(--transition); filter: drop-shadow(0 0 8px rgba(139,92,246,0.4));}
.drop-icon-sm { font-size: 24px; margin-bottom: 8px;}
.sub-text { display: block; font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.text-xs { font-size: 12px; font-weight: 500; }
.text-highlight { color: var(--primary-hover); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.preview-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #0b0f19; z-index: 20; display: flex; align-items: center; justify-content: center; animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;}
@keyframes popIn { 0% { opacity: 0; transform: scale(0.95); } 100% { opacity: 1; transform: scale(1); } }
.preview-container img { max-width: 100%; max-height: 100%; object-fit: cover; opacity: 0.8; transition: opacity 0.3s; }
.preview-container:hover img { opacity: 0.5; }

.btn-icon { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,0.6); color: white; border: 1px solid rgba(255,255,255,0.2); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; backdrop-filter: blur(4px); transition: var(--transition); display: flex; align-items: center; justify-content: center; font-size: 12px; z-index: 30; opacity: 0; transform: translateY(-5px);}
.preview-container:hover .btn-icon { opacity: 1; transform: translateY(0); }
.btn-icon:hover { background: var(--error); border-color: var(--error); transform: scale(1.1) !important;}

/* Settings */
.settings-wrapper { margin-bottom: 24px; }
.btn-ghost { background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 14px; display: flex; align-items: center; gap: 6px; transition: var(--transition); }
.btn-ghost:hover { color: var(--text-main); text-shadow: 0 0 8px rgba(255,255,255,0.3); }
.settings-panel { margin-top: 12px; padding: 16px; background: rgba(0,0,0,0.2); border-radius: var(--radius-md); border: 1px solid var(--input-border); }

.hidden { display: none !important; }
.text-center { text-align: center; }

/* Buttons */
.btn-primary, .btn-secondary { width: 100%; padding: 16px; border: none; border-radius: var(--radius-md); font-family: var(--font-display); font-size: 16px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; transition: var(--transition); position: relative; overflow: hidden; }
.btn-primary { background: var(--primary-gradient); color: white; margin-top: 16px; box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3); }
.btn-primary::after { content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent); transform: skewX(-20deg); transition: 0.5s; }
.btn-primary:not(:disabled):hover::after { left: 150%; }
.btn-primary:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(139, 92, 246, 0.5); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { background: #334155; color: #94a3b8; box-shadow: none; cursor: not-allowed; }

/* Loader AI Terminal Style */
.loader-container { position: relative; width: 60px; height: 60px; margin: 0 auto 24px; display: flex; align-items: center; justify-content: center; }
.spinner { position: absolute; width: 100%; height: 100%; border: 3px solid transparent; border-top-color: var(--primary); border-bottom-color: #3b82f6; border-radius: 50%; animation: spin 1.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite; }
.spinner::before { content: ''; position: absolute; top: 8px; left: 8px; right: 8px; bottom: 8px; border: 3px solid transparent; border-right-color: var(--accent); border-radius: 50%; animation: spin 2s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-title { font-size: 20px; font-family: var(--font-display); font-weight: 600; background: var(--primary-gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent;}
.loading-desc { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
.progress-wrapper { margin: 32px 0; }
.progress-track { width: 100%; height: 8px; background: rgba(255,255,255,0.05); border-radius: 4px; overflow: hidden; margin-bottom: 10px; box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);}
.progress-fill { height: 100%; width: 0%; background: var(--primary-gradient); transition: width 1s ease-out; position: relative; box-shadow: 0 0 10px rgba(139,92,246,0.6);}
.progress-fill::after { content:''; position: absolute; top:0; left:0; width:100%; height:100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent); animation: shimmer 1.5s infinite; }
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

.time-stats { display: flex; justify-content: space-between; font-family: monospace; font-size: 13px; color: var(--text-muted); }

/* Terminal Logs */
.log-box { background: rgba(0,0,0,0.4); border-radius: var(--radius-sm); padding: 16px; font-size: 13px; font-family: monospace; text-align: left; color: #64748b; border: 1px solid rgba(255,255,255,0.05); max-height: 140px; overflow-y: auto; box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);}
.log-entry { margin-bottom: 6px; display: flex; align-items: flex-start; gap: 8px;}
.log-entry.pulse { color: #e2e8f0; animation: logPulse 1.5s ease-in-out infinite alternate;}
@keyframes logPulse { from { opacity: 0.8; text-shadow: none; } to { opacity: 1; text-shadow: 0 0 8px rgba(255,255,255,0.4); } }

/* Results */
.success-badge { width: 70px; height: 70px; border-radius: 50%; padding: 16px; background: rgba(16, 185, 129, 0.2); border: 2px solid var(--success); color: var(--success); display: flex; align-items:center; justify-content:center; font-size: 32px; margin: 0 auto 20px; box-shadow: 0 0 20px rgba(16,185,129,0.3); animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);}
.success-title { font-size: 24px; font-family: var(--font-display); font-weight: 700; margin-bottom: 24px; color: #fff;}

.media-grid { display: flex; flex-direction: column; gap: 16px; margin-bottom: 32px; }
.video-wrapper { border-radius: var(--radius-md); overflow: hidden; background: #000; box-shadow: 0 10px 30px rgba(0,0,0,0.5); width: 100%; max-width: 300px; margin: 0 auto; aspect-ratio: 9/16; border: 1px solid rgba(255,255,255,0.1);}
.video-wrapper.multiple { max-width: 100%; width: auto; aspect-ratio: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; background: transparent; box-shadow: none; border: none;}
.video-item { aspect-ratio: 9/16; width: 100%; height: 100%; object-fit: cover; display: block; border-radius: var(--radius-md); border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 4px 12px rgba(0,0,0,0.3);}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); border-radius: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

/* Responsive Grid */
@media (max-width: 600px) {
  .app-container { margin: 0; padding: 0; max-width: 100%; }
  .glass-card { min-height: 100vh; border-radius: 0; border: none; border-top: none; }
  .form-row { flex-direction: column; gap: 16px;}
  .half { width: 100%; }
}
