/* ================================================
   SIREPAI TUTORIAL STYLES
   Tutorial interactivo para registro de papeletas
   Colores institucionales: Azul #1363D0, Verde #22A070
   Estilo consistente con el dashboard
   ================================================ */

/* ================================================
   Variables CSS (fallback si no están definidas)
   ================================================ */
:root {
    --primary: #1363D0;
    --primary-dark: #0d4a9e;
    --success: #22A070;
    --warning: #fd7e14;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f4;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-500: #6c757d;
    --gray-600: #555;
    --gray-700: #495057;
}

/* ================================================
   TUTORIAL SPOTLIGHT - Tour Interactivo
   ================================================ */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.tutorial-overlay.active {
    opacity: 1;
    visibility: visible;
}

.tutorial-spotlight {
    position: fixed;
    z-index: 9999;
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.75),
                0 0 30px rgba(255, 255, 255, 0.3);
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.tutorial-spotlight.active {
    opacity: 1;
}

.tutorial-spotlight::before {
    content: '';
    position: absolute;
    inset: -4px;
    border: 3px solid #fbbf24;
    border-radius: 14px;
    animation: spotlightPulse 2s ease-in-out infinite;
}

@keyframes spotlightPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.5);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 20px 8px rgba(251, 191, 36, 0.3);
        transform: scale(1.02);
    }
}

/* ================================================
   Tutorial Tooltip (estilo dashboard)
   ================================================ */
.tutorial-tooltip {
    position: fixed;
    z-index: 10000;
    background: white;
    border-radius: 16px;
    padding: 0;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3),
                0 10px 20px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

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

.tutorial-tooltip-header {
    background: linear-gradient(135deg, #1363D0 0%, #0d4a9e 100%);
    color: white;
    padding: 18px 20px;
    border-radius: 16px 16px 0 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tutorial-tooltip-header .step-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: white !important;
    white-space: nowrap;
}

.tutorial-tooltip-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    flex: 1;
    color: white !important;
}

.tutorial-tooltip-body {
    padding: 20px;
}

.tutorial-tooltip-body p {
    margin: 0 0 16px 0;
    color: var(--gray-600);
    font-size: 14px;
    line-height: 1.6;
}

.tutorial-tooltip-body p:last-child {
    margin-bottom: 0;
}

.tutorial-tooltip-body .feature-list {
    background: var(--gray-50);
    border-radius: 10px;
    padding: 14px;
    margin: 12px 0;
    list-style: none;
}

.tutorial-tooltip-body .feature-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 13px;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-200);
}

.tutorial-tooltip-body .feature-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.tutorial-tooltip-body .feature-list li:first-child {
    padding-top: 0;
}

.tutorial-tooltip-body .feature-list li i {
    color: var(--primary);
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* Estados de colores en la leyenda */
.tutorial-tooltip-body .color-legend {
    background: var(--gray-50);
    border-radius: 10px;
    padding: 14px;
    margin: 12px 0;
}

.tutorial-tooltip-body .color-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 13px;
    color: var(--gray-700);
}

.tutorial-tooltip-body .color-legend-item .color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tutorial-tooltip-footer {
    padding: 16px 20px;
    background: var(--gray-50);
    border-radius: 0 0 16px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.tutorial-dots {
    display: flex;
    gap: 8px;
}

.tutorial-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gray-300);
    transition: all 0.3s ease;
    cursor: pointer;
}

.tutorial-dots .dot:hover {
    background: var(--gray-500);
}

.tutorial-dots .dot.active {
    background: var(--primary);
    transform: scale(1.2);
}

.tutorial-dots .dot.completed {
    background: var(--success);
}

.tutorial-actions {
    display: flex;
    gap: 10px;
}

.tutorial-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tutorial-btn-skip {
    background: transparent;
    color: var(--gray-500);
}

.tutorial-btn-skip:hover {
    color: var(--gray-700);
    background: var(--gray-100);
}

.tutorial-btn-next {
    background: linear-gradient(135deg, #1363D0 0%, #0d4a9e 100%);
    color: white;
}

.tutorial-btn-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(19, 99, 208, 0.4);
}

.tutorial-btn-finish {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
}

.tutorial-btn-finish:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
}

/* ================================================
   Nota y Warning dentro del tooltip
   ================================================ */
.tutorial-note {
    background: rgba(19, 99, 208, 0.08);
    border-left: 3px solid #1363D0;
    padding: 10px 12px;
    border-radius: 0 8px 8px 0;
    margin: 12px 0 0 0;
    font-size: 13px;
    color: #1363D0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.tutorial-note i {
    margin-top: 2px;
}

.tutorial-warning {
    background: rgba(253, 126, 20, 0.08);
    border-left: 3px solid #fd7e14;
    padding: 10px 12px;
    border-radius: 0 8px 8px 0;
    margin: 12px 0 0 0;
    font-size: 13px;
    color: #c45d00;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.tutorial-warning i {
    margin-top: 2px;
}

/* ================================================
   Botón de ayuda flotante
   ================================================ */
.tutorial-help-btn {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1363D0 0%, #0d4fa3 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(19, 99, 208, 0.4);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
}

.tutorial-help-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(19, 99, 208, 0.5);
}

.tutorial-help-btn:active {
    transform: scale(0.95);
}

.tutorial-help-btn .pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(19, 99, 208, 0.3);
    animation: tutorialPulse 2s ease-out infinite;
}

@keyframes tutorialPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* Tooltip del botón de ayuda */
.tutorial-help-btn::after {
    content: 'Tutorial';
    position: absolute;
    right: 60px;
    background: #333;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.tutorial-help-btn:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ================================================
   Botón de ayuda en el modal header
   ================================================ */
.modal-help-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease;
    margin-left: 10px;
}

.modal-help-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* ================================================
   Welcome Modal (SweetAlert2 customization)
   ================================================ */
.swal2-popup.tutorial-welcome {
    border-radius: 16px !important;
    padding: 30px !important;
}

.tutorial-welcome-content {
    text-align: center;
}

.tutorial-welcome-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1363D0 0%, #0d4fa3 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 20px;
    box-shadow: 0 8px 25px rgba(19, 99, 208, 0.3);
}

.tutorial-welcome-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.tutorial-welcome-subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.tutorial-welcome-steps {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 25px 0;
    flex-wrap: wrap;
}

.tutorial-welcome-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    min-width: 100px;
}

.tutorial-welcome-step-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.tutorial-welcome-step-icon.step-1 {
    background: rgba(19, 99, 208, 0.12);
    color: #1363D0;
}

.tutorial-welcome-step-icon.step-2 {
    background: rgba(34, 160, 112, 0.12);
    color: #22A070;
}

.tutorial-welcome-step-icon.step-3 {
    background: rgba(253, 126, 20, 0.12);
    color: #fd7e14;
}

.tutorial-welcome-step-icon.step-4 {
    background: rgba(111, 66, 193, 0.12);
    color: #6f42c1;
}

.tutorial-welcome-step-text {
    font-size: 11px;
    color: #666;
    font-weight: 500;
}

/* ================================================
   Responsive adjustments
   ================================================ */
@media (max-width: 768px) {
    .tutorial-tooltip {
        max-width: 320px;
    }
}

@media (max-width: 576px) {
    .tutorial-tooltip {
        max-width: 300px;
        margin: 10px;
    }

    .tutorial-tooltip-header {
        padding: 14px 16px;
    }

    .tutorial-tooltip-header h4 {
        font-size: 15px;
    }

    .tutorial-tooltip-body {
        padding: 16px;
    }

    .tutorial-tooltip-footer {
        padding: 14px 16px;
        flex-direction: column;
        gap: 12px;
    }

    .tutorial-actions {
        width: 100%;
        justify-content: space-between;
    }

    .tutorial-help-btn {
        width: 45px;
        height: 45px;
        bottom: 80px;
        right: 15px;
    }

    .tutorial-welcome-steps {
        gap: 10px;
    }

    .tutorial-welcome-step {
        min-width: 80px;
        padding: 10px;
    }
}

/* ================================================
   Animation for tutorial elements
   ================================================ */
@keyframes tutorialBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.tutorial-tooltip.bounce {
    animation: tutorialBounce 1s ease;
}

@keyframes tutorialShake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.tutorial-shake {
    animation: tutorialShake 0.5s ease;
}

/* Highlight pulsante para elementos importantes */
@keyframes tutorialHighlight {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(19, 99, 208, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(19, 99, 208, 0);
    }
}

.tutorial-highlight {
    animation: tutorialHighlight 1.5s ease-in-out infinite;
}
