/* ==========================================================================
   DESIGN SYSTEM & VARIABLES (ALR SAAS PROMO)
   ========================================================================== */
:root {
  --accent: #00e5ff;
  --accent-secondary: #3b82f6;
  --bg-dark: #030509;
  --bg-card: rgba(10, 15, 25, 0.6);
  --border-glass: rgba(255, 255, 255, 0.05);
  --text-primary: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.6);
  --danger: #ff3860;
  --success: #23d160;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
}

/* ==========================================================================
   APP LAYOUT (SPLIT SCREEN)
   ========================================================================== */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* LEFT SIDEBAR: EDITOR */
.editor-sidebar {
  width: 400px;
  background: rgba(4, 7, 13, 0.9);
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  height: 100%;
  backdrop-filter: blur(20px);
  z-index: 10;
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-glass);
}

.brand-title {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-title span {
  color: var(--accent);
  text-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
}

.brand-subtitle {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 800;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 6px;
}
.sidebar-scroll::-webkit-scrollbar-thumb {
  background: var(--border-glass);
  border-radius: 3px;
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.3);
}

/* RIGHT MAIN WORKSPACE: PREVIEW */
.preview-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: radial-gradient(circle at 70% 30%, rgba(13, 20, 35, 0.8), #030509);
  position: relative;
  overflow-y: auto;
}

.preview-workspace::-webkit-scrollbar {
  width: 6px;
}
.preview-workspace::-webkit-scrollbar-thumb {
  background: var(--border-glass);
  border-radius: 3px;
}

.workspace-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.workspace-header h1 {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.5px;
  text-transform: uppercase;
  font-style: italic;
  background: linear-gradient(90deg, #fff, var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.workspace-header p {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================================================
   FORMS & INPUTS (EDITOR SIDEBAR)
   ========================================================================== */
.settings-card, .scene-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  transition: all 0.3s ease;
}

.scene-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.settings-card h3, .scene-card h3 {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #fff;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.scene-card h3 span {
  color: var(--accent);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group-row {
  display: flex;
  gap: 12px;
}

.form-group-row .form-group {
  flex: 1;
}

.form-label {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.form-input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: 6px;
  color: #fff;
  padding: 8px 12px;
  font-size: 12px;
  outline: none;
  transition: all 0.3s;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.15);
}

input[type="color"] {
  height: 32px;
  padding: 2px;
  cursor: pointer;
  width: 100%;
}

/* ==========================================================================
   SMARTPHONE VIEWPORT STAGE
   ========================================================================== */
.simulator-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* REALISTIC PHONE FRAME */
.phone-frame {
  width: 330px;
  height: 660px;
  background: #1c1c1e;
  border-radius: 44px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 0 12px #2c2c2e;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Notch / Speaker / Camera Details */
.phone-speaker {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: #3a3a3c;
  border-radius: 2px;
  z-index: 100;
}

.phone-camera {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  background: #09090b;
  border-radius: 50%;
  border: 1.5px solid #27272a;
  z-index: 100;
}

/* Active Screen Area */
.phone-screen {
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  background: #030509;
  border-radius: 36px;
  position: relative;
  overflow: hidden;
  user-select: none;
}

/* ==========================================================================
   VIDEO/SCENE GRAPHICS & TIMELINE ANIMATIONS
   ========================================================================== */
.video-overlay-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 50%, transparent 60%, rgba(3, 5, 9, 0.9));
  z-index: 5;
  pointer-events: none;
}

/* Animated Parallax/Movement Video Background */
.video-background-parallax {
  position: absolute;
  top: -10%;
  left: -10%;
  width: 120%;
  height: 120%;
  background: radial-gradient(circle at center, rgba(13, 27, 42, 0.8) 0%, rgba(3, 5, 9, 1) 100%);
  transition: transform 0.1s linear;
  z-index: 1;
}

/* Particle Grid Effect in Background */
.video-background-parallax::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(255,255,255,0.01) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.01) 1px, transparent 1px);
  background-size: 20px 20px;
  transform: skewY(-5deg);
}

.scene-stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 30px;
  text-align: center;
  z-index: 2;
}

/* Scene Content Animations */
.animate-in {
  animation: slideUp 0.8s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.animate-glow {
  animation: pulseGlow 2s infinite alternate;
}

.animate-glitch {
  animation: textGlitch 0.3s infinite;
}

/* SCENE ELEMENTS */
.video-icon {
  font-size: 56px;
  margin-bottom: 20px;
  color: var(--accent);
  filter: drop-shadow(0 0 15px rgba(0, 229, 255, 0.5));
}

.video-title {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
  line-height: 1.2;
}

.video-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  font-weight: 400;
  max-width: 240px;
}

/* SPECIAL ELEMENTS FOR SCENE 3 & 4 (UI Wireframes) */
.ui-simulation-box {
  width: 220px;
  background: rgba(10, 15, 25, 0.8);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 14px;
  margin-top: 20px;
  text-align: left;
  animation: zoomGlow 1s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.ui-row {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  margin-bottom: 8px;
  width: 100%;
}
.ui-row.short { width: 60%; }
.ui-row.accent { background: var(--accent); opacity: 0.8; }

.ui-pulse-indicator {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: pingGlow 1.5s infinite;
}

/* ==========================================================================
   PLAYER CONTROLS BAR (BOTTOM)
   ========================================================================== */
.player-controls-bar {
  background: rgba(4, 7, 13, 0.95);
  border-top: 1px solid var(--border-glass);
  padding: 20px 24px;
  backdrop-filter: blur(20px);
  z-index: 10;
}

/* Timeline/Progress Bar */
.progress-container {
  position: relative;
  width: 100%;
  height: 6px;
  margin-bottom: 16px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-container input[type="range"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 15;
}

.progress-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-secondary), var(--accent));
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
  z-index: 10;
  transition: width 0.1s linear;
}

.controls-layout {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-ctrl {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  transition: all 0.3s;
}

.btn-ctrl:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
}

.time-display {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  font-family: monospace;
  opacity: 0.6;
}

.audio-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   BUTTONS & GENERAL UTILITIES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  padding: 0 16px;
  height: 36px;
  cursor: pointer;
  outline: none;
  transition: all 0.3s;
  border: 1px solid transparent;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-glass);
  color: #fff;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-outline {
  background: transparent;
  border-color: rgba(255,255,255,0.15);
  color: #fff;
}
.btn-outline:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.3);
}

/* ==========================================================================
   INSTANT TOAST NOTIFICATIONS
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(10, 15, 25, 0.95);
  border: 1px solid var(--border-glass);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 20000;
  transform: translateY(100px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

#toast-icon {
  font-size: 16px;
}

#toast-message {
  font-size: 11px;
  font-weight: 800;
  color: #fff;
}

/* ==========================================================================
   KEYFRAME ANIMATIONS
   ========================================================================== */
@keyframes slideUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseGlow {
  0% {
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
  }
  100% {
    text-shadow: 0 0 25px rgba(0, 229, 255, 0.6), 0 0 50px rgba(0, 229, 255, 0.2);
  }
}

@keyframes textGlitch {
  0% {
    transform: translate(0);
  }
  20% {
    transform: translate(-2px, 2px);
    color: var(--danger);
  }
  40% {
    transform: translate(-2px, -2px);
    text-shadow: 2px 2px var(--accent);
  }
  60% {
    transform: translate(2px, 2px);
    color: var(--accent-secondary);
  }
  80% {
    transform: translate(2px, -2px);
  }
  100% {
    transform: translate(0);
  }
}

@keyframes zoomGlow {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 30px rgba(0, 229, 255, 0.15);
  }
}

@keyframes pingGlow {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0;
  }
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 900px) {
  .app-container {
    flex-direction: column;
    overflow-y: auto;
  }
  
  .editor-sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-glass);
  }

  .preview-workspace {
    height: 700px;
  }
}

/* ==========================================================================
   TEXT ALIGNMENT, ANIMATIONS & TITLE SIZES
   ========================================================================== */
/* Alineaciones de escena */
.scene-stage.align-top {
  justify-content: flex-start !important;
  padding-top: 60px !important;
  padding-bottom: 30px !important;
}
.scene-stage.align-center {
  justify-content: center !important;
  padding-top: 30px !important;
  padding-bottom: 30px !important;
}
.scene-stage.align-bottom {
  justify-content: flex-end !important;
  padding-bottom: 60px !important;
  padding-top: 30px !important;
}

/* Tamaños de títulos */
.video-title.title-sm { font-size: 16px !important; }
.video-title.title-md { font-size: 22px !important; }
.video-title.title-lg { font-size: 28px !important; }
.video-title.title-xl { font-size: 34px !important; }

/* Nuevas Animaciones de Entrada */
.anim-slide-up {
  animation: slideUp 0.8s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}
.anim-glitch {
  animation: textGlitch 0.3s infinite;
}
.anim-fade-in {
  animation: fadeIn 0.8s ease forwards;
}
.anim-zoom-in {
  animation: zoomIn 0.8s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}
.anim-typewriter {
  animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes zoomIn {
  0% { opacity: 0; transform: scale(0.7); }
  100% { opacity: 1; transform: scale(1); }
}
