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

:root {
  /* Premium Dark Mode Palette */
  --bg-dark: #0f172a;
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  
  /* Brand/Accent Colors */
  --primary: #6366f1; /* Indigo vibrant */
  --primary-hover: #4f46e5;
  --accent: #ec4899; /* Pink neon */
  --accent-secondary: #8b5cf6; /* Purple soft */
  
  /* Status Colors */
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.2);
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.2);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.2);
  
  /* Glassmorphism Specs */
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-bg-hover: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-blur: blur(20px);
  
  /* Text */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-accent: #e2e8f0;
}

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

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg-dark);
  background-image: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  position: relative;
  overflow-x: hidden;
}

/* Background Ambient Orbs */
body::before, body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  z-index: -1;
  opacity: 0.5;
  animation: floatOrb 10s infinite alternate ease-in-out;
}

body::before {
  top: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: rgba(99, 102, 241, 0.3);
}

body::after {
  bottom: -10%;
  right: -10%;
  width: 40vw;
  height: 40vw;
  background: rgba(236, 72, 153, 0.2);
  animation-delay: -5s;
}

@keyframes floatOrb {
  0% { transform: translateY(0px) scale(1); }
  100% { transform: translateY(50px) scale(1.1); }
}

/* PANTALLA DE ACCESO DENEGADO */
.access-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-dark);
  background-image: var(--bg-gradient);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 1rem;
}

.access-container {
  width: 100%;
  max-width: 500px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.access-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  display: inline-block;
}

.access-container h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.access-container p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.access-details {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 16px;
  padding: 1.5rem;
  margin: 2rem 0;
  text-align: left;
}

.access-details strong {
  color: var(--primary);
}

.access-details ul {
  list-style: none;
  margin-top: 1rem;
}

.access-details li {
  color: var(--text-accent);
  margin: 0.7rem 0;
  font-size: 0.95rem;
}

.access-cta {
  margin-top: 2rem;
}

.access-cta p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Main Container */
.app-container {
  width: 100%;
  max-width: 600px;
  min-width: 280px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 32px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  position: relative;
}

/* Header */
header {
  padding: 2.5rem 2rem;
  text-align: center;
  position: relative;
  border-bottom: 1px solid var(--glass-border);
}

header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.brand-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

h1 {
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}

.subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  padding: 1.5rem 2rem 0;
  gap: 1rem;
}

.tab-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 1rem;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.tab-btn:hover {
  background: var(--glass-bg-hover);
  color: var(--text-accent);
}

.tab-btn.active {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.5);
  color: #fff;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.tab-btn.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
}

/* Content Area */
.content {
  padding: 2rem;
}

.section {
  display: none;
  animation: fadeInDown 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.section.active {
  display: block;
}

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

/* Toggle Buttons */
.toggle-group {
  display: flex;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 14px;
  padding: 0.3rem;
  margin-bottom: 2rem;
  border: 1px solid var(--glass-border);
}

.toggle-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-weight: 600;
  padding: 0.8rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.toggle-btn.active {
  background: var(--glass-bg-hover);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255,255,255,0.05);
}

/* Form Groups */
.form-group {
  margin-bottom: 1.5rem;
  position: relative;
}

label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-accent);
  margin-bottom: 0.75rem;
}

/* Tooltip / Educational Info */
.info-icon {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  width: 20px;
  height: 20px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: help;
  transition: all 0.2s;
}

.info-icon:hover {
  background: var(--primary);
  color: #fff;
  transform: scale(1.1);
}

.edu-text {
  font-size: 0.85rem;
  color: var(--text-accent);
  margin-bottom: 0.75rem;
  line-height: 1.6;
  background: rgba(99, 102, 241, 0.08);
  border-left: 3px solid var(--primary);
  padding: 1rem;
  border-radius: 0 8px 8px 0;
  display: none;
  animation: fadeIn 0.3s ease;
}

.edu-text strong {
  color: var(--primary);
  font-weight: 600;
}

.edu-text ul {
  margin: 0.5rem 0 0.5rem 1.2rem;
  padding-left: 0;
}

.edu-text li {
  margin: 0.3rem 0;
  color: var(--text-accent);
}

.edu-text.show {
  display: block;
}

/* Inputs */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix {
  position: absolute;
  left: 1.2rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 1.1rem;
}

input[type="number"] {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  color: #fff;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 1.2rem 1.2rem 1.2rem 2.8rem; /* Padding for prefix */
  border-radius: 16px;
  outline: none;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

/* Special input without prefix */
input.no-prefix {
  padding-left: 1.2rem;
}

input[type="number"]:focus {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), inset 0 2px 4px rgba(0,0,0,0.1);
}

input[type="number"]::placeholder {
  color: rgba(148, 163, 184, 0.4);
}

/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type=number] {
  -moz-appearance: textfield;
}

/* Main Button */
.btn-main {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--accent-secondary));
  color: white;
  border: none;
  padding: 1.3rem;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 16px;
  cursor: pointer;
  margin-top: 1rem;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.4);
  position: relative;
  overflow: hidden;
}

.btn-main::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: 0.5s;
}

.btn-main:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 25px -5px rgba(99, 102, 241, 0.5);
}

.btn-main:hover::before {
  left: 100%;
}

.btn-main:active {
  transform: scale(0.98);
}

/* Results Area */
.result-wrapper {
  display: none;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--glass-border);
  position: relative;
  animation: fadeIn 0.6s ease;
}

.result-wrapper::before {
  content: "Tu Análisis";
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-dark);
  padding: 0 1rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  font-weight: 600;
  border-radius: 20px;
}

/* Result Cards */
.result-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 480px) {
  .result-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.stat-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, background 0.3s ease;
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

.stat-card.full-width {
  grid-column: 1 / -1;
}

.stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  margin: 0.5rem 0;
  letter-spacing: -1px;
}

/* Specific Stat Styling */
.stat-card.positive { border-left: 4px solid var(--success); }
.stat-card.negative { border-left: 4px solid var(--danger); }
.stat-card.warning { border-left: 4px solid var(--warning); }
.stat-card.neutral { border-left: 4px solid var(--primary); }

.stat-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 0.75rem;
  margin-top: 0.5rem;
}

.stat-desc strong {
  color: var(--text-accent);
}

/* ROAS Bar */
.roas-container {
  height: 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  margin: 1rem 0;
  overflow: hidden;
  position: relative;
}

.roas-fill {
  height: 100%;
  width: 0%;
  border-radius: 4px;
  transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.5s ease;
  position: relative;
}

.roas-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 2s infinite;
}

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

/* Premium Highlight Box (LTV / Simulator) */
.premium-box {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.05));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 20px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  position: relative;
}

.premium-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

/* Slider */
.simulator-slider {
  margin: 1.5rem 0;
}

input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  outline: none;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  cursor: pointer;
  transition: 0.2s;
}

input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.sim-val {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
  text-shadow: 0 0 15px rgba(236, 72, 153, 0.4);
}

/* CTAs and Secondary Actions */
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
  border-top: 1px solid var(--glass-border);
  padding-top: 1.5rem;
}

.btn-sec {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-accent);
  padding: 1rem;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.btn-sec:hover {
  background: rgba(255,255,255,0.1);
  transform: translateY(-2px);
}

.btn-whatsapp {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: white;
  border: none;
  padding: 1.25rem;
  border-radius: 16px;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  box-shadow: 0 10px 20px -5px rgba(37, 211, 102, 0.4);
}

.btn-whatsapp:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 15px 25px -5px rgba(37, 211, 102, 0.5);
}

/* Animations Tools */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Print Styles */
.print-only { display: none; }
@media print {
  @page { margin: 1.5cm; }
  body { 
    background: white !important; 
    color: black !important;
    padding: 0;
  }
  .app-container {
    box-shadow: none;
    border: none;
    max-width: 100%;
    background: transparent !important;
    backdrop-filter: none;
  }
  .no-print, .btn-main, .action-grid, .simulator-slider, input, .info-icon, .nav-tabs, .edu-text { 
    display: none !important; 
  }
  .print-only { 
    display: block; 
    font-weight: bold; 
    color: #000;
    font-size: 1.2rem;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
  }
  h1 { color: #000; -webkit-text-fill-color: #000; background: none; }
  .section { display: block !important; margin-bottom: 2rem; }
  .result-wrapper { display: block !important; border-top: 2px solid #000; }
  .stat-card {
    border: 1px solid #ccc;
    background: transparent !important;
    color: #000 !important;
    break-inside: avoid;
  }
  .stat-value { color: #000 !important; text-shadow: none; }
  .stat-desc { color: #555 !important; border-color: #eee; }
  * { text-shadow: none !important; box-shadow: none !important; }
}

/* Responsive Design - Tablets y Pantallas Grandes */
@media (min-width: 768px) {
  body {
    padding: 2rem 1rem;
  }
  
  .app-container {
    animation: slideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  
  @keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }
  
  header {
    padding: 2.5rem 2rem;
  }
  
  .content {
    padding: 2rem;
  }
}

@media (max-width: 480px) {
  header {
    padding: 1.5rem 1rem;
  }
  
  .content {
    padding: 1.5rem;
  }
  
  h1 {
    font-size: 1.8rem;
  }
  
  .nav-tabs {
    padding: 1rem 1.5rem 0;
  }
  
  .form-group label {
    font-size: 0.9rem;
  }
}
