/* CSS Premium para el Tutorial Interactivo */

:root {
    --tutorial-bg: #ffffff;
    --tutorial-border: rgba(0, 55, 100, 0.18);
    --tutorial-glow: 0 10px 30px rgba(0, 55, 100, 0.15);
    --accent-blue: #00d0f0;
    --accent-green: #00f0a8;
}

/* --- EFECTO SPOTLIGHT (FOCO) --- */
.tutorial-highlight {
    z-index: 10001 !important;
    box-shadow: 0 0 0 9999px rgba(0, 8, 20, 0.82), 
                0 0 25px 8px var(--accent-blue) !important;
    transition: all 0.3s ease-in-out !important;
    pointer-events: auto !important;
    overflow: visible !important;
}

/* --- OVERLAY DE BLOQUEO DE CLICS --- */
#tutorial-blocker {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    background: transparent;
    pointer-events: auto;
}

/* --- PULSO DE COMPONENTE DISPONIBLE --- */
.tutorial-pulsing {
    overflow: visible !important;
    animation: tutorial-pulse-shadow 2.2s infinite ease-in-out !important;
}

/* Ocultar el pulso de los elementos dentro del menú lateral si este está cerrado para evitar que se desborde el brillo */
#side-menu:not(.show) .tutorial-pulsing {
    animation: none !important;
    box-shadow: none !important;
}

@keyframes tutorial-pulse-shadow {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 208, 240, 0.75);
    }
    70% {
        box-shadow: 0 0 0 14px rgba(0, 208, 240, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 208, 240, 0);
    }
}

/* --- MODAL DE BIENVENIDA PREMIUM --- */
#tutorial-welcome-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 10, 30, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20000;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    padding: 20px;
    box-sizing: border-box;
}

#tutorial-welcome-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.tutorial-card {
    position: relative;
    background: var(--tutorial-bg);
    border: 1px solid var(--tutorial-border);
    box-shadow: var(--tutorial-glow);
    border-radius: 24px;
    width: 100%;
    max-width: 440px;
    padding: 35px 25px;
    text-align: center;
    box-sizing: border-box;
    transform: translateY(30px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.welcome-close-btn {
    position: absolute;
    top: 15px;
    right: 18px;
    font-size: 24px;
    font-weight: bold;
    color: #005086;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
    user-select: none;
    z-index: 10;
}

.welcome-close-btn:hover {
    color: #ff3b30;
    transform: scale(1.1);
}

#tutorial-welcome-modal.show .tutorial-card {
    transform: translateY(0);
}

.tutorial-card img.logo {
    width: 100px;
    height: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 8px rgba(0, 55, 100, 0.15));
}

.tutorial-card h2 {
    font-family: 'League Spartan', sans-serif;
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 15px 0;
    color: #003764;
    letter-spacing: 0.5px;
}

.tutorial-card p {
    font-size: 15px;
    line-height: 1.6;
    color: #005086;
    margin: 0 0 25px 0;
}

.tutorial-btn-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tutorial-btn {
    background: linear-gradient(135deg, #003764, #005086);
    color: #ffffff;
    border: none;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 15px rgba(0, 55, 100, 0.2);
    font-family: inherit;
}

.tutorial-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 55, 100, 0.3);
    filter: brightness(1.15);
}

.tutorial-btn.secondary {
    background: rgba(0, 55, 100, 0.05);
    color: #003764;
    border: 1px solid rgba(0, 55, 100, 0.15);
    box-shadow: none;
}

.tutorial-btn.secondary:hover {
    background: rgba(0, 55, 100, 0.1);
    border-color: #003764;
    transform: translateY(-2px);
}

/* --- TOOLTIP INTERACTIVO GLASSMORPHISM --- */
.tutorial-tooltip {
    position: absolute;
    z-index: 10005;
    background: var(--tutorial-bg);
    border: 1px solid var(--tutorial-border);
    box-shadow: var(--tutorial-glow), 0 20px 40px rgba(0, 55, 100, 0.12);
    border-radius: 20px;
    padding: 20px;
    width: 280px;
    box-sizing: border-box;
    opacity: 0;
    transform: scale(0.92) translateY(10px);
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}

.tutorial-tooltip.show {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.tutorial-tooltip h3 {
    font-family: 'League Spartan', sans-serif;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #003764;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tutorial-tooltip p {
    font-size: 13.5px;
    line-height: 1.5;
    color: #005086;
    margin: 0 0 16px 0;
}

.tutorial-tooltip-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.tutorial-step-counter {
    font-size: 11px;
    color: rgba(0, 55, 100, 0.6);
    font-weight: 500;
}

.tutorial-tooltip-btn {
    background: linear-gradient(135deg, #003764, #005086);
    color: #ffffff;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(0, 55, 100, 0.15);
}

.tutorial-tooltip-btn:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 55, 100, 0.25);
}

.tutorial-tooltip-btn.close-btn {
    background: rgba(0, 55, 100, 0.05);
    color: #003764;
    border: 1px solid rgba(0, 55, 100, 0.15);
    box-shadow: none;
}

.tutorial-tooltip-btn.close-btn:hover {
    background: rgba(0, 55, 100, 0.1);
}

/* --- FLECHA DEL TOOLTIP --- */
.tutorial-tooltip::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-left: 1px solid var(--tutorial-border);
    border-top: 1px solid var(--tutorial-border);
    z-index: -1;
    transform: rotate(45deg);
    display: none; /* Se activa dinámicamente según la posición */
}

/* Flecha Arriba */
.tutorial-tooltip.arrow-top::before {
    display: block;
    top: -7px;
    left: calc(50% - 6px);
    transform: rotate(45deg);
}

/* Flecha Abajo */
.tutorial-tooltip.arrow-bottom::before {
    display: block;
    bottom: -7px;
    left: calc(50% - 6px);
    transform: rotate(225deg);
}

/* Flecha Abajo Izquierda (para elementos en esquinas izquierdas) */
.tutorial-tooltip.arrow-bottom-left::before {
    display: block;
    bottom: -7px;
    left: 25px;
    right: auto;
    transform: rotate(225deg);
}

/* Flecha Arriba Izquierda (para elementos en esquinas izquierdas) */
.tutorial-tooltip.arrow-top-left::before {
    display: block;
    top: -7px;
    left: 25px;
    right: auto;
    transform: rotate(45deg);
}

/* Flecha Abajo Derecha (para elementos en esquinas como WhatsApp) */
.tutorial-tooltip.arrow-bottom-right::before {
    display: block;
    bottom: -7px;
    right: 25px;
    left: auto;
    transform: rotate(225deg);
}

/* Flecha Izquierda */
.tutorial-tooltip.arrow-left::before {
    display: block;
    left: -7px;
    top: calc(50% - 6px);
    transform: rotate(315deg);
}

/* Flecha Derecha */
.tutorial-tooltip.arrow-right::before {
    display: block;
    right: -7px;
    top: calc(50% - 6px);
    transform: rotate(135deg);
}


/* --- FLECHA ANIMADA PARA CONOCER LA AGENDA --- */
#tutorial-swipe-arrow {
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    background: #003764;
    border: 1.5px solid var(--accent-blue);
    box-shadow: 0 0 15px rgba(0, 208, 240, 0.4);
    color: #ffffff;
    padding: 8px 14px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: swipePulse 1.4s infinite ease-in-out;
    z-index: 10002;
    pointer-events: none;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.2px;
}

#tutorial-swipe-arrow i {
    font-size: 13px;
    color: var(--accent-blue);
}

@keyframes swipePulse {
    0% {
        transform: translateY(-50%) translateX(0);
        opacity: 0.85;
    }
    50% {
        transform: translateY(-50%) translateX(6px);
        opacity: 1;
        box-shadow: 0 0 25px rgba(0, 208, 240, 0.75);
    }
    100% {
        transform: translateY(-50%) translateX(0);
        opacity: 0.85;
    }
}
