/* CodetechVE — animaciones y menú lateral del panel.
   Se carga al final para ir por encima de public-refresh.css y dashboard-refresh.css.
   Basado en componentes del segundo cerebro (versiones propias en CSS/JS nativo). */
:root { --spring:cubic-bezier(.34,1.36,.64,1); --out:cubic-bezier(.22,1,.36,1); }

/* ========== Compartido ========== */
@keyframes fxRise { from { opacity:0; transform:translateY(14px); } }
@keyframes fxBlurIn { from { opacity:0; filter:blur(10px); transform:translateY(10px); } }
@keyframes fxPop { from { opacity:0; transform:translateY(10px) scale(.96); } }

/* Text Shimmer: brillo que recorre el texto mientras espera */
.shimmer-text { background:linear-gradient(100deg, currentColor 35%, rgba(255,255,255,.95) 50%, currentColor 65%); background-size:250% 100%; -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; animation:fxShimmer 1.6s linear infinite; }
.btn-primary .shimmer-text { background-image:linear-gradient(100deg, currentColor 35%, rgba(255,255,255,.9) 50%, currentColor 65%); }
@keyframes fxShimmer { from { background-position:150% 0; } to { background-position:-50% 0; } }

/* Confetti */
.confetti-bit { position:fixed; z-index:70; width:8px; height:10px; border-radius:2px; pointer-events:none; will-change:transform,opacity; }

/* ========== Página pública ========== */
/* Scroll Progress */
.scroll-progress { position:fixed; top:0; left:0; right:0; z-index:60; height:3px; background:linear-gradient(90deg,#547639,var(--accent)); transform:scaleX(0); transform-origin:left; pointer-events:none; }

/* Text Effect / Blur Fade: titular palabra a palabra */
.fx-word { display:inline-block; animation:fxBlurIn .8s var(--out) both; }

/* Word Rotate en la píldora del hero */
.rotator { display:inline-block; min-width:4.5ch; font-weight:700; transition:transform .26s var(--out), opacity .26s var(--out), filter .26s var(--out); }
.rotator.is-out { opacity:0; transform:translateY(-60%); filter:blur(3px); }
.rotator.is-in { opacity:0; transform:translateY(60%); transition:none; }

/* Entrada de la vista previa y de las tarjetas de plataforma */
.hero-demo { animation:fxRise .8s .25s var(--out) both; }
.plat-card.fx-pop { animation:fxPop .55s var(--out) both; }
.plat-card { transition:transform .35s var(--out), box-shadow .35s var(--out); will-change:transform; }

/* Text Scramble: cada casilla «late» al recibir su dígito */
.ct-code span.is-hit { animation:fxSlotHit .5s var(--spring); }
@keyframes fxSlotHit { 0% { transform:translateY(-6px) scale(.9); background:#2e4a36; } 60% { transform:translateY(1px) scale(1.04); } 100% { transform:none; } }
.ct-bar span.is-filling { animation:fxFill 6s linear both; transform-origin:left; }
@keyframes fxFill { from { transform:scaleX(0); } to { transform:scaleX(1); } }

/* Glare Hover / Shimmer Button: destello que cruza el botón principal */
.hero-cta .btn, .sheet-foot .btn-primary { position:relative; overflow:hidden; isolation:isolate; }
.hero-cta .btn::after, .sheet-foot .btn-primary::after { content:""; position:absolute; inset:-2px; z-index:-1; background:linear-gradient(110deg, transparent 30%, rgba(255,255,255,.28) 48%, transparent 66%); transform:translateX(-120%); pointer-events:none; }
.hero-cta .btn::after { animation:fxGlare 5s 2.4s var(--out) infinite; }
@media (hover:hover) {
  .hero-cta .btn:hover::after, .sheet-foot .btn-primary:hover::after { animation:fxGlareOnce .8s var(--out); }
}
@keyframes fxGlare { 0%, 70% { transform:translateX(-120%); } 90%, 100% { transform:translateX(120%); } }
@keyframes fxGlareOnce { from { transform:translateX(-120%); } to { transform:translateX(120%); } }

/* Magic Card / Spotlight: luz que sigue al cursor */
@media (hover:hover) {
  .step:hover, .support:hover, .code-ticket:hover, .plat-tile:hover { background-image:radial-gradient(320px circle at var(--mx,50%) var(--my,50%), rgba(201,239,95,.16), transparent 70%); }
  .code-ticket:hover { background-image:radial-gradient(260px circle at var(--mx,50%) var(--my,50%), rgba(255,255,255,.55), transparent 70%); }
}

/* Selector de plataforma: el punto del radio entra con resorte */
.plat-tile.active .plat-check::after { animation:fxDot .38s var(--spring); }
@keyframes fxDot { from { transform:scale(0); } }
.plat-tile { transition:border-color .2s var(--out), background-color .2s var(--out), transform .2s var(--out); }

/* Border Trail: luz que recorre el borde mientras esperamos el código */
@property --trail { syntax:'<angle>'; initial-value:0deg; inherits:false; }
.border-trail { position:relative; border-color:transparent!important; background:linear-gradient(var(--surface,#203025),var(--surface,#203025)) padding-box, conic-gradient(from var(--trail), transparent 0 70%, var(--accent) 85%, transparent 100%) border-box!important; animation:fxTrail 2.2s linear infinite; }
@keyframes fxTrail { to { --trail:360deg; } }

/* Resultado: el recuadro del código entra con resorte */
.code-box { animation:fxPop .5s var(--spring) both; }

/* ========== Panel: menú lateral vertical ========== */
body.dash .shell { display:grid; grid-template-columns:236px minmax(0,1fr); align-items:start; min-height:0; }
body.dash .side { position:sticky; top:70px; z-index:30; display:flex; flex-direction:column; gap:2px; width:auto; height:calc(100dvh - 70px); overflow-x:hidden; overflow-y:auto; padding:18px 12px 24px; border:0; border-right:1px solid var(--border); background:#111c15; backdrop-filter:none; scrollbar-width:thin; }
body.dash .nav-item { position:relative; z-index:1; flex:none; justify-content:flex-start; width:100%; min-height:42px; padding:0 .85rem; border-radius:11px; background:transparent; color:var(--text2); font-size:.88rem; font-weight:500; white-space:nowrap; transition:color .25s var(--out), transform .2s var(--out); }
body.dash .nav-item:hover { background:rgba(255,255,255,.04); color:var(--text); }
body.dash .nav-item.active { background:transparent; color:var(--accent-ink); font-weight:600; }
body.dash .nav-item.active::before { display:none; }
body.dash .nav-item.active::after { color:var(--accent-ink); opacity:1; }
body.dash .nav-item:active { transform:scale(.97); }
body.dash .nav-item[data-tab]::after { width:17px; height:17px; }

/* Animated Background: la píldora lima se desliza hasta la sección activa */
.nav-indicator { position:absolute; top:0; left:0; z-index:0; border-radius:11px; background:var(--accent); box-shadow:0 8px 22px -12px rgba(201,239,95,.7); pointer-events:none; transition:transform .45s var(--spring), height .3s var(--out), width .3s var(--out), opacity .2s; }

body.dash .content { margin:0 auto; }

/* Móvil y tablet: riel vertical de iconos */
@media (max-width:900px) {
  body.dash .shell { grid-template-columns:62px minmax(0,1fr); }
  body.dash .side { top:70px; height:calc(100dvh - 70px); padding:12px 8px; }
  body.dash .nav-item { justify-content:center; min-height:46px; padding:0; font-size:0; gap:0; }
  body.dash .nav-item[data-tab]::after { width:20px; height:20px; }
  body.dash .content { padding-left:14px; padding-right:14px; }
}
@media (max-width:640px) {
  body.dash .side { top:62px; height:calc(100dvh - 62px); }
}

/* Animated Group: las secciones del panel entran en cascada */
.fx-rise { animation:fxRise .45s var(--out) both; animation-delay:var(--stagger,0ms); }

/* Spotlight en métricas y paneles */
@media (hover:hover) {
  .stat:hover, .account-stat:hover { background-image:radial-gradient(220px circle at var(--mx,50%) var(--my,50%), rgba(201,239,95,.1), transparent 70%); }
  .panel:hover, .support-ticket:hover { background-image:radial-gradient(420px circle at var(--mx,50%) var(--my,50%), rgba(201,239,95,.045), transparent 70%); }
}
.stat .n, .account-stat strong { font-variant-numeric:tabular-nums; }

/* Campana: balanceo cuando llegan avisos nuevos */
.notification-bell.is-ringing svg { animation:fxRing .9s var(--out); transform-origin:50% 10%; }
@keyframes fxRing { 0%,100% { transform:rotate(0); } 15% { transform:rotate(16deg); } 30% { transform:rotate(-13deg); } 45% { transform:rotate(9deg); } 60% { transform:rotate(-6deg); } 75% { transform:rotate(3deg); } }
.notification-badge { animation:fxDot .4s var(--spring); }

/* Hojas del panel: entrada lateral ya definida; los campos aparecen en cascada */
.modal > div:last-child > * { animation:fxRise .4s var(--out) both; }
.modal > div:last-child > *:nth-child(2) { animation-delay:.04s; }
.modal > div:last-child > *:nth-child(3) { animation-delay:.08s; }
.modal > div:last-child > *:nth-child(4) { animation-delay:.12s; }
.modal > div:last-child > *:nth-child(n+5) { animation-delay:.16s; }

/* ========== Reducir movimiento ========== */
@media (prefers-reduced-motion:reduce) {
  .fx-word, .hero-demo, .plat-card.fx-pop, .fx-rise, .code-box, .modal > div:last-child > *, .notification-badge { animation:none!important; }
  .shimmer-text { animation:none; -webkit-text-fill-color:currentColor; background:none; }
  .hero-cta .btn::after, .sheet-foot .btn-primary::after { display:none; }
  .border-trail { animation:none; }
  .nav-indicator, .rotator { transition:none; }
  .scroll-progress { display:none; }
}

/* Iconos de línea que sustituyen a los símbolos de texto en los botones del panel */
.btn-ico { width:16px; height:16px; flex:none; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; vertical-align:-3px; }
button:not(.btn) > .btn-ico:not(:only-child), a:not(.btn) > .btn-ico:not(:only-child) { margin-right:.35rem; }
.is-icon-only { display:inline-grid; place-items:center; }
.is-icon-only .btn-ico { width:17px; height:17px; }
@media (hover:hover) { .btn:hover .btn-ico { transform:none; } }
button:active .btn-ico { transform:scale(.92); transition:transform .15s var(--out); }
