/* ==========================================================================
   Estilos Principales - CV LaTeX AI (Micro-SaaS Serverless)
   ========================================================================== */

:root {
  --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Paleta de Colores Moderna (Dark Mode Premium) */
  --bg-dark: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.75);
  --bg-card-border: rgba(255, 255, 255, 0.12);
  --bg-input: #1e293b;
  
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  --accent-cyan: #06b6d4;
  --accent-gradient: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --success-color: #10b981;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-glow: 0 10px 30px -10px rgba(59, 130, 246, 0.3);
}

/* Reset y base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Fondo animado decorativo */
.bg-gradient-shapes {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.shape {
  position: absolute;
  filter: blur(120px);
  opacity: 0.35;
  border-radius: 50%;
}

.shape-1 {
  width: 450px;
  height: 450px;
  background: #3b82f6;
  top: -100px;
  right: -50px;
}

.shape-2 {
  width: 500px;
  height: 500px;
  background: #06b6d4;
  bottom: -150px;
  left: -100px;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navbar */
.navbar {
  padding: 20px 0;
  border-bottom: 1px solid var(--bg-card-border);
  backdrop-filter: blur(10px);
  background: rgba(15, 23, 42, 0.6);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-weight: 800;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-text {
  letter-spacing: -0.5px;
}

.badge {
  background: var(--accent-gradient);
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 700;
  vertical-align: middle;
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text-main);
}

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 50px 0 30px;
}

.badge-pill {
  display: inline-block;
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.3);
  padding: 6px 16px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -1px;
}

.text-highlight {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto 25px;
}

.trust-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
}

.trust-item {
  font-size: 0.85rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 12px;
  border-radius: 6px;
}

/* Card Principal de la App */
.app-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  margin-bottom: 60px;
}

/* Tabs */
.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 25px;
  background: rgba(15, 23, 42, 0.5);
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--bg-card-border);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 14px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.25s ease;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

/* Tab Contents */
.tab-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tab-content.hidden {
  display: none;
}

/* Formularios e Inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
}

.form-control {
  background-color: var(--bg-input);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.form-control::placeholder {
  color: var(--text-dim);
}

.mb-2 {
  margin-bottom: 8px;
}

/* Dropzone para archivos */
.drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  padding: 35px 20px;
  text-align: center;
  background: rgba(15, 23, 42, 0.4);
  cursor: pointer;
  transition: all 0.25s ease;
}

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

.drop-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 10px;
}

.drop-title {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.browse-btn {
  color: #60a5fa;
  text-decoration: underline;
  font-weight: 600;
}

.drop-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.file-input-hidden {
  display: none;
}

.file-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(37, 99, 235, 0.4);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-top: 10px;
}

.file-preview-name {
  font-weight: 500;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-remove-file {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.btn-remove-file:hover {
  opacity: 1;
}

/* Sección de Pago */
.payment-section {
  margin-top: 30px;
  padding-top: 25px;
  border-top: 1px solid var(--bg-card-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.price-box {
  text-align: center;
  background: rgba(15, 23, 42, 0.6);
  padding: 16px 28px;
  border-radius: var(--radius-md);
  border: 1px solid var(--bg-card-border);
  width: 100%;
  max-width: 400px;
}

.price-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.price-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.1;
  margin: 4px 0;
}

.price-value .currency {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-cyan);
}

.price-subtext {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.legal-checkbox-container {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

.checkbox-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.legal-checkbox-container a {
  color: #60a5fa;
  text-decoration: underline;
}

.paypal-container {
  width: 100%;
  max-width: 400px;
  min-height: 50px;
}

/* Mensajes de Estado / Error */
.status-message {
  width: 100%;
  max-width: 400px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  text-align: center;
}

.status-message.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.status-message.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

/* Overlay de Carga */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.spinner-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 40px 30px;
  text-align: center;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

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

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  margin-top: 20px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-gradient);
  transition: width 0.4s ease;
}

/* Modal de Resultados */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 35px;
  max-width: 550px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-icon {
  font-size: 2rem;
}

.modal-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 25px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px -5px rgba(59, 130, 246, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--bg-card-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
}

.btn-link:hover {
  color: var(--text-main);
}

.latex-code-wrapper {
  margin: 15px 0;
  background: #020617;
  border-radius: var(--radius-sm);
  border: 1px solid var(--bg-card-border);
  overflow: hidden;
}

.latex-code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-small {
  background: var(--primary-color);
  color: #fff;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
}

.latex-code-wrapper pre {
  padding: 12px;
  font-family: monospace;
  font-size: 0.8rem;
  max-height: 200px;
  overflow-y: auto;
  color: #38bdf8;
}

/* Info Section */
.info-section {
  padding: 40px 0;
}

.section-title {
  text-align: center;
  font-size: 1.75rem;
  margin-bottom: 30px;
  font-weight: 700;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.feature-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--bg-card-border);
  padding: 24px;
  border-radius: var(--radius-md);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  font-weight: 600;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Footer */
.footer {
  border-top: 1px solid var(--bg-card-border);
  padding: 30px 0;
  margin-top: 40px;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.footer-links {
  display: flex;
  gap: 20px;
}

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

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

.hidden {
  display: none !important;
}

/* Selector de Planes */
.plan-selector {
  margin-top: 30px;
  margin-bottom: 20px;
  text-align: center;
  width: 100%;
}

.plan-selector-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--text-main);
  text-align: center;
}

.plan-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 550px;
  margin: 0 auto;
}

.plan-card {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-card:hover {
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-2px);
}

.plan-card.active {
  background: rgba(37, 99, 235, 0.12);
  border-color: var(--primary-color);
  box-shadow: 0 0 15px rgba(37, 99, 235, 0.15);
}

.plan-badge {
  position: absolute;
  top: -10px;
  right: 12px;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.plan-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.plan-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.plan-price .currency {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 5px;
}

/* Modal y Overlay de Anuncio */
.ad-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ad-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 30px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ad-modal-header h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 5px;
}

.ad-modal-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ad-container-box {
  background: #020617;
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 20px 15px;
  position: relative;
}

.ad-label {
  position: absolute;
  top: 6px;
  left: 12px;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.ad-content-placeholder {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-mock-video {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.ad-mock-badge {
  background: var(--warning-color);
  color: #000;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.ad-mock-play {
  font-size: 2.2rem;
  animation: pulse-glow 2s infinite;
}

.ad-mock-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.ad-mock-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.4;
  margin-bottom: 5px;
}

.ad-countdown-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ad-countdown-container p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ad-countdown-container strong {
  color: var(--accent-cyan);
  font-size: 1.1rem;
}

.w-100 {
  width: 100%;
}

@keyframes pulse-glow {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 0.8; }
}

/* Adaptación Mobile */
@media (max-width: 640px) {
  .hero-title {
    font-size: 2rem;
  }
  .app-card {
    padding: 20px 15px;
  }
  .mode-tabs {
    grid-template-columns: 1fr;
  }
  .plan-cards {
    grid-template-columns: 1fr;
  }
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}
