/* ==========================================================================
   TelecoUniPamplona - Halloween Spooky Theme & Interactive Effects
   ========================================================================== */

/* Variables temáticas de Halloween */
:root[data-halloween="true"], body.halloween-theme {
    --hw-orange: #ff7518;
    --hw-orange-glow: rgba(255, 117, 24, 0.45);
    --hw-purple: #8b00ff;
    --hw-purple-dark: #2c0847;
    --hw-slime: #39ff14;
    --hw-blood: #c5234b;
    --hw-bg-dark: #0c0910;
}

/* Modo Halloween Global: Acentos e Iluminación */
body.halloween-theme {
    --accent: var(--hw-orange);
    --accent-hover: #ff9142;
    --accent-rgb: 255, 117, 24;
}

body.halloween-theme .navbar {
    border-bottom: 1px solid rgba(255, 117, 24, 0.25);
    box-shadow: 0 4px 20px rgba(139, 0, 255, 0.15);
}

/* Telarañas de esquina decorativas */
.hw-web-corner {
    position: fixed;
    top: 0;
    width: 140px;
    height: 140px;
    pointer-events: none;
    z-index: 9990;
    opacity: 0.65;
    transition: opacity 0.3s ease;
}
.hw-web-left { left: 0; }
.hw-web-right { right: 0; transform: scaleX(-1); }

/* Murciélagos o fantasmas flotantes */
.hw-floating-creature {
    position: fixed;
    pointer-events: none;
    z-index: 9992;
    font-size: 1.6rem;
    filter: drop-shadow(0 2px 8px rgba(255, 117, 24, 0.5));
    animation: hwFloatAcross 16s linear infinite;
    user-select: none;
}

@keyframes hwFloatAcross {
    0% {
        transform: translate(-60px, 110vh) rotate(5deg) scale(0.8);
        opacity: 0;
    }
    10% {
        opacity: 0.9;
    }
    85% {
        opacity: 0.85;
    }
    100% {
        transform: translate(105vw, -80px) rotate(-15deg) scale(1.1);
        opacity: 0;
    }
}

/* Botón Toggle de Halloween en la Navbar */
.hw-toggle-btn {
    background: rgba(255, 117, 24, 0.12);
    border: 1px solid rgba(255, 117, 24, 0.35);
    color: #ff9142;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.25s ease;
    user-select: none;
    white-space: nowrap;
}

.hw-toggle-btn:hover {
    background: rgba(255, 117, 24, 0.25);
    border-color: #ff7518;
    transform: translateY(-1px);
    box-shadow: 0 0 12px var(--hw-orange-glow);
}

.hw-toggle-btn.active {
    background: #ff7518;
    color: #110e17;
    border-color: #ff7518;
    box-shadow: 0 0 15px rgba(255, 117, 24, 0.6);
}

.hw-toggle-btn .hw-icon-bounce {
    display: inline-block;
    animation: hwPumpkinBob 2s infinite ease-in-out;
}

@keyframes hwPumpkinBob {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-3px) rotate(8deg); }
}

/* Banner de Halloween */
.hw-banner-top {
    background: linear-gradient(90deg, #1b092b 0%, #3e0c59 50%, #1b092b 100%);
    border-bottom: 1px solid rgba(255, 117, 24, 0.4);
    color: #ffd8a8;
    padding: 8px 16px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    position: relative;
    z-index: 1001;
}

.hw-banner-top .hw-badge {
    background: #ff7518;
    color: #0b0710;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    text-transform: uppercase;
}

/* ==========================================================================
   INTERACTIVIDAD EN PARCIALES Y EVALUACIONES
   ========================================================================== */

/* Temporizador en modo pánico / alerta de Halloween (últimos 5 minutos) */
.timer-pill.hw-timer-spooky {
    background: #38080f !important;
    border: 1px solid #ff3366 !important;
    color: #ffb3c6 !important;
    box-shadow: 0 0 16px rgba(255, 51, 102, 0.6) !important;
    animation: hwPulseBlood 1s infinite alternate !important;
}

@keyframes hwPulseBlood {
    0% {
        box-shadow: 0 0 10px rgba(255, 51, 102, 0.4);
        transform: scale(1);
    }
    100% {
        box-shadow: 0 0 22px rgba(255, 51, 102, 0.85);
        transform: scale(1.04);
    }
}

/* Poción burbujeante de progreso del examen */
.hw-cauldron-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(20, 12, 30, 0.75);
    border: 1px solid rgba(139, 0, 255, 0.4);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    color: #bfa3ff;
}

.hw-cauldron-progress .potion-bar {
    width: 80px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.hw-cauldron-progress .potion-fill {
    height: 100%;
    background: linear-gradient(90deg, #39ff14, #ff7518);
    transition: width 0.4s ease;
    box-shadow: 0 0 8px #39ff14;
}

/* Modal Interactivo / Ruleta Trick or Treat al finalizar parcial */
.hw-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 4, 15, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: hwFadeIn 0.3s ease;
}

@keyframes hwFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hw-modal-card {
    background: linear-gradient(145deg, #180e29 0%, #0d0618 100%);
    border: 2px solid #ff7518;
    border-radius: 20px;
    max-width: 480px;
    width: 100%;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(255, 117, 24, 0.35), 0 0 80px rgba(139, 0, 255, 0.25);
    position: relative;
    overflow: hidden;
    animation: hwPopModal 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes hwPopModal {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.hw-modal-card .hw-modal-icon {
    font-size: 4rem;
    margin-bottom: 12px;
    display: inline-block;
    animation: hwWiggle 2s infinite ease-in-out;
}

@keyframes hwWiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.hw-modal-card h3 {
    color: #ff9142;
    font-size: 1.6rem;
    margin-bottom: 8px;
    font-family: inherit;
}

.hw-modal-card p {
    color: #d1c4e9;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

.hw-badge-halloween {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 117, 24, 0.15);
    border: 1px solid #ff7518;
    color: #ffd8a8;
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: 600;
    margin-bottom: 20px;
}

/* ==========================================================================
   MINI-JUEGO: PUMPKIN HUNT (Easter Egg de Calabazas Ocultas)
   ========================================================================== */
.hw-hidden-pumpkin {
    position: fixed;
    width: 38px;
    height: 38px;
    background: #ff7518;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(255, 117, 24, 0.7);
    z-index: 9980;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s;
    user-select: none;
    border: 2px solid #ffaa40;
}

.hw-hidden-pumpkin:hover {
    transform: scale(1.25) rotate(12deg);
}

.hw-hidden-pumpkin.collected {
    animation: hwCollectBurst 0.6s forwards;
}

@keyframes hwCollectBurst {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.6) translateY(-20px); opacity: 0.8; }
    100% { transform: scale(0); opacity: 0; pointer-events: none; }
}

/* Toast de Logro / Notificación de Calabaza */
.hw-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #190e29;
    border: 1px solid #ff7518;
    color: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6), 0 0 15px rgba(255, 117, 24, 0.4);
    z-index: 10005;
    animation: hwToastIn 0.35s ease, hwToastOut 0.35s 3.5s forwards;
}

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

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

/* ==========================================================================
   ESTELAS INTERACTIVAS DEL MOUSE (SPARKS & GHOST FOLLOWER)
   ========================================================================== */

/* Canvas para estela de chispas de fuego fatuo */
#hw-trail-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 99998;
}

/* Fantasmita seguidor con inercia elástica */
.hw-ghost-follower {
    position: fixed;
    pointer-events: none;
    z-index: 99999;
    width: 38px;
    height: 44px;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    will-change: transform, left, top;
    filter: drop-shadow(0 0 10px rgba(57, 255, 20, 0.65)) drop-shadow(0 0 20px rgba(139, 0, 255, 0.4));
    transition: opacity 0.3s ease;
    user-select: none;
}

.hw-ghost-follower svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    animation: hwGhostBob 1.6s ease-in-out infinite alternate;
}

@keyframes hwGhostBob {
    0% { transform: translateY(-3px) scale(0.97); }
    100% { transform: translateY(3px) scale(1.03); }
}

