/* ============================================
   LDC Panel — Constructor de Presupuestos
   Estilos basados en Drasve Dev System
   ============================================ */

/* RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; transition: background 0.3s ease, color 0.3s ease; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* VARIABLES */
:root {
    --bg: #050508;
    --bg-card: #0a0a0f;
    --bg-elevated: #0f0f18;
    --border: rgba(255,255,255,0.06);
    --border-hover: rgba(255,255,255,0.12);
    --text: #e4e4e7;
    --text-muted: #71717a;
    --text-dim: #52525b;
    --accent-1: #6366f1;
    --accent-2: #a855f7;
    --accent-3: #06b6d4;
    --gradient: linear-gradient(135deg, var(--accent-1), var(--accent-2), var(--accent-3));
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', monospace;
    --radius: 16px;
    --radius-sm: 10px;
    --nav-h: 72px;
    --success: #10b981;
    --error: #ef4444;
}

html.light-theme {
    --bg: #F8FAFC;
    --bg-card: rgba(255,255,255,0.8);
    --bg-elevated: #F1F5F9;
    --border: rgba(0,0,0,0.08);
    --border-hover: rgba(0,0,0,0.15);
    --text: #0F172A;
    --text-muted: #475569;
    --text-dim: #64748B;
}

/* UTILITIES */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.gradient-text { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.w-full { width: 100%; }

/* ANIMATIONS */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.8s cubic-bezier(0.16,1,0.3,1), transform 0.8s cubic-bezier(0.16,1,0.3,1); }
.reveal.revealed { opacity: 1; transform: translateY(0); }

/* NAVBAR */
.navbar { position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h); z-index: 1000; transition: background 0.3s ease, box-shadow 0.3s ease; }
.navbar.scrolled { background: rgba(5,5,8,0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 1px 0 var(--border); }
html.light-theme .navbar.scrolled { background: rgba(248,250,252,0.85); }
.nav-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; height: 100%; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { font-weight: 900; font-size: 1.25rem; letter-spacing: -0.02em; display: flex; align-items: center; }
.logo-bracket { font-family: var(--mono); color: var(--accent-1); font-weight: 700; }
.logo-highlight { color: var(--accent-2); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-muted); transition: all 0.3s ease; border: 1px solid var(--border); }
.theme-toggle:hover { color: var(--text); border-color: var(--border-hover); background: var(--bg-elevated); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html.light-theme .theme-toggle .icon-sun { display: block; }
html.light-theme .theme-toggle .icon-moon { display: none; }

/* SECTIONS */
.main-content { padding-top: calc(var(--nav-h) + 40px); padding-bottom: 60px; }
.section { padding: 32px 0; }
.section-header { text-align: center; margin-bottom: 48px; }
.section-tag { display: inline-block; padding: 6px 16px; background: rgba(99,102,241,0.08); border: 1px solid rgba(99,102,241,0.15); border-radius: 999px; font-size: 0.75rem; font-weight: 700; color: var(--accent-1); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 16px; }
.section-title { font-size: clamp(2rem, 4vw, 3rem); font-weight: 900; letter-spacing: -0.025em; line-height: 1.15; margin-bottom: 12px; }
.section-subtitle { font-size: 1rem; color: var(--text-muted); max-width: 500px; margin: 0 auto; line-height: 1.6; }

/* OPTION SELECTOR */
.option-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 20px 24px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.option-title { font-size: 1rem; font-weight: 700; margin-bottom: 2px; }
.option-desc { font-size: 0.8rem; color: var(--text-muted); }
.option-selector { display: flex; gap: 4px; padding: 4px; background: var(--bg-elevated); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.option-btn { padding: 10px 20px; border-radius: 8px; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); transition: all 0.3s ease; white-space: nowrap; }
.option-btn:hover { color: var(--text); }
.option-btn.active { background: var(--accent-1); color: white; }

/* CONTENT LAYOUT */
.content-layout { display: grid; grid-template-columns: 1fr 380px; gap: 32px; align-items: start; }

/* MODULES */
.modules-section { margin-bottom: 32px; }
.modules-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modules-section-title { font-size: 1.1rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.modules-hint { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px; }
.modules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 12px; }
.module-card { display: flex; align-items: flex-start; gap: 14px; padding: 18px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; transition: all 0.3s ease; position: relative; overflow: hidden; }
.module-card:hover { border-color: var(--border-hover); }
.module-card.selected { border-color: var(--accent-1); background: rgba(99,102,241,0.03); }
.card-glow { position: absolute; inset: 0; border-radius: var(--radius); opacity: 0; transition: opacity 0.3s ease; background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(99,102,241,0.06), transparent 40%); pointer-events: none; z-index: 0; }
.module-card:hover .card-glow { opacity: 1; }
.module-check { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--border-hover); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.3s ease; margin-top: 2px; position: relative; z-index: 1; }
.module-card.selected .module-check { background: var(--accent-1); color: white; border-color: var(--accent-1); }
.module-info { flex: 1; min-width: 0; position: relative; z-index: 1; }
.module-name { font-weight: 700; font-size: 0.9rem; margin-bottom: 3px; }
.module-desc { color: var(--text-muted); font-size: 0.78rem; line-height: 1.5; }
.module-price { text-align: right; flex-shrink: 0; position: relative; z-index: 1; }
.module-price-implant { font-family: var(--mono); font-weight: 700; font-size: 0.95rem; color: var(--accent-1); }
.module-price-monthly { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

/* SUMMARY */
.summary-column { position: sticky; top: calc(var(--nav-h) + 24px); }
.summary-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.summary-title { font-size: 1rem; font-weight: 700; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.summary-section { margin-bottom: 16px; }
.summary-section-title { font-size: 0.7rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.summary-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 0.82rem; border-bottom: 1px solid var(--border); }
.summary-row:last-child { border-bottom: none; }
.summary-row .label { color: var(--text-muted); }
.summary-row .value { font-weight: 600; font-family: var(--mono); font-size: 0.8rem; }
.summary-total { display: flex; justify-content: space-between; align-items: center; padding: 12px 0 8px; border-top: 2px solid var(--border-hover); margin-top: 8px; }
.summary-total-label { color: var(--text); font-weight: 700; font-size: 0.9rem; }
.summary-total-value { font-weight: 700; font-family: var(--mono); font-size: 1.1rem; color: var(--accent-1); }
.summary-total-highlight { font-size: 1.2rem; }
.summary-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
.summary-note { font-size: 0.7rem; color: var(--text-dim); margin-top: 12px; line-height: 1.5; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 24px; border-radius: 999px; font-weight: 600; font-size: 0.9rem; transition: all 0.3s ease; position: relative; overflow: hidden; white-space: nowrap; }
.btn-primary { background: var(--accent-1); color: white; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(99,102,241,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.15), transparent); transition: left 0.5s ease; }
.btn-primary:hover::after { left: 200%; }
.btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--border-hover); }
.btn-secondary:hover { background: var(--bg-elevated); border-color: var(--text-dim); }
.btn-lg { padding: 16px 32px; font-size: 1rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn .spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.6s linear infinite; }

/* BADGES */
.badge { display: inline-flex; padding: 4px 12px; border-radius: 999px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.badge-primary { background: rgba(99,102,241,0.1); color: var(--accent-1); border: 1px solid rgba(99,102,241,0.2); }
.badge-info { background: rgba(6,182,212,0.1); color: var(--accent-3); border: 1px solid rgba(6,182,212,0.2); }

/* TOAST */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 10000; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 14px 20px; border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 500; animation: fadeInUp 0.3s ease; display: flex; align-items: center; gap: 10px; box-shadow: 0 8px 32px rgba(0,0,0,0.3); min-width: 240px; }
.toast-success { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3); color: var(--success); }
.toast-error { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: var(--error); }
.toast-info { background: rgba(99,102,241,0.15); border: 1px solid rgba(99,102,241,0.3); color: var(--accent-1); }

/* FOOTER */
.footer { padding: 32px 24px; border-top: 1px solid var(--border); text-align: center; font-size: 0.8rem; color: var(--text-dim); }
.footer a { color: var(--accent-1); transition: color 0.3s ease; }
.footer a:hover { color: var(--accent-2); }

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }

/* RESPONSIVE */
@media (max-width: 900px) {
    .content-layout { grid-template-columns: 1fr; }
    .summary-column { position: static; }
    .option-row { flex-direction: column; align-items: flex-start; }
    .option-selector { width: 100%; }
    .option-btn { flex: 1; text-align: center; }
}
@media (max-width: 600px) {
    .module-card { flex-direction: column; }
    .module-price { text-align: left; }
    .summary-row { flex-direction: column; gap: 2px; align-items: flex-start; }
}
