/* Tutorial Completo Block - Frontend Styles */

.tutorial-completo {
    margin: 40px 0;
}

/* ============================================
   VIDEO INTRODUCTORIO
   ============================================ */

.tutorial-intro-video {
    margin-bottom: 40px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.tutorial-intro-video iframe {
    width: 100%;
    height: 500px;
    display: block;
}

@media (max-width: 768px) {
    .tutorial-intro-video iframe {
        height: 300px;
    }
}

/* ============================================
   PASOS DEL TUTORIAL
   ============================================ */

.tutorial-steps-section {
    margin-bottom: 60px;
}

.tutorial-step {
    background: #ffffff;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.step-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.step-number {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #6BA4E8;
    color: #ffffff;
    padding: 8px 20px;
    border-radius: 24px;
    font-weight: 600;
}

.step-label {
    font-size: 14px;
}

.step-num {
    font-size: 20px;
    font-weight: 700;
}

.step-lock-icon {
    font-size: 24px;
}

/* Ocultar candado para usuarios registrados */
body.logged-in .step-lock-icon {
    display: none;
}

.step-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2C3E50;
    margin-bottom: 24px;
}

/* VIDEO */
.step-video {
    margin-bottom: 24px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.step-video iframe {
    width: 100%;
    height: 400px;
    display: block;
}

@media (max-width: 768px) {
    .step-video iframe {
        height: 250px;
    }
}

/* DESKTOP: Imagen izquierda, texto derecha */
.step-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 20px;
}

.step-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.step-description {
    line-height: 1.8;
    color: #4A5568;
}

.step-description p {
    margin-bottom: 16px;
}

.step-tip {
    background: #FFF9F0;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #FFD93D;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.tip-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.tip-content {
    color: #2C3E50;
    line-height: 1.6;
}

/* LOCKED STATE - MEJORADO */
.tutorial-step.is-private {
    position: relative;
}

/* Ocultar overlay si está logueado */
body.logged-in .step-lock-overlay {
    display: none !important;
}

/* Blur content for non-logged users */
body:not(.logged-in) .tutorial-step.is-private .step-content,
body:not(.logged-in) .tutorial-step.is-private .step-tip,
body:not(.logged-in) .tutorial-step.is-private .step-video {
    filter: blur(8px);
    pointer-events: none;
    user-select: none;
    opacity: 0.3;
}

/* Overlay real (no pseudo-elemento) */
.step-lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* CRÍTICO: Solo mostrar overlay en pasos con clase show-overlay */
.tutorial-step:not(.show-overlay) .step-lock-overlay {
    display: none !important;
}

.step-lock-message {
    text-align: center;
    background: #ffffff;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    max-width: 400px;
}

.step-lock-message .lock-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.step-lock-message h4 {
    font-size: 1.5rem;
    color: #2C3E50;
    margin-bottom: 12px;
}

.step-lock-message p {
    color: #7F8C8D;
    margin-bottom: 24px;
    line-height: 1.6;
}

.btn-register-step {
    display: inline-block;
    padding: 12px 32px;
    background: #6BA4E8;
    color: #ffffff;
    text-decoration: none;
    border-radius: 24px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-register-step:hover {
    background: #5A93D7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 164, 232, 0.3);
}

/* Badge de "más pasos bloqueados" */
.more-steps-locked {
    text-align: center;
    padding: 30px;
    margin-top: 40px;
}

body.logged-in .more-steps-locked {
    display: none;
}

.locked-steps-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #6BA4E8 0%, #A8C9F0 100%);
    color: #ffffff;
    padding: 16px 32px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 4px 16px rgba(107, 164, 232, 0.3);
}

.lock-icon-badge {
    font-size: 1.5rem;
}

/* MOBILE: Todo vertical */
@media (max-width: 768px) {
    .tutorial-step {
        padding: 20px;
    }
    
    .step-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .step-title {
        font-size: 1.3rem;
    }
}

/* ============================================
   EXTRAS DESCARGABLES
   ============================================ */

.tutorial-extras-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 3px solid #e1e8ed;
}

.extras-title {
    font-size: 2rem;
    color: #2C3E50;
    margin-bottom: 40px;
    text-align: center;
}

.extra-item {
    background: #ffffff;
    border: 2px solid #e1e8ed;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    transition: all 0.3s;
}

.extra-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(107, 164, 232, 0.15);
    border-color: #6BA4E8;
}

.extra-image {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    position: relative;
}

.extra-image img {
    width: 100%;
    height: auto;
    display: block;
    /* Protección contra descarga */
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    pointer-events: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Capa transparente sobre la imagen */
.extra-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 1;
}

.extra-content h3 {
    font-size: 1.5rem;
    color: #2C3E50;
    margin-bottom: 12px;
}

.extra-content p {
    color: #7F8C8D;
    line-height: 1.6;
    margin-bottom: 24px;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: #6BA4E8;
    color: #ffffff;
    border: none;
    border-radius: 24px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

.btn-download:hover {
    background: #5A93D7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 164, 232, 0.3);
}

.btn-download:active {
    transform: translateY(0);
}

/* MOBILE: Extras verticales */
@media (max-width: 768px) {
    .tutorial-extras-section {
        margin-top: 40px;
        padding-top: 30px;
    }
    
    .extras-title {
        font-size: 1.5rem;
        margin-bottom: 30px;
    }
    
    .extra-item {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 20px;
    }
    
    .extra-content h3 {
        font-size: 1.3rem;
    }
    
    .btn-download {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   MODAL DE REGISTRO
   ============================================ */

.download-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.download-modal.active {
    display: flex;
}

.download-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.download-modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideUp 0.3s ease-out;
}

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

.download-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: #9EAEB8;
    transition: color 0.3s;
}

.download-modal-close:hover {
    color: #2C3E50;
}

.download-modal-icon {
    font-size: 4rem;
    text-align: center;
    margin-bottom: 20px;
}

.download-modal h2 {
    font-size: 1.8rem;
    color: #2C3E50;
    margin-bottom: 12px;
    text-align: center;
}

.download-modal p {
    color: #7F8C8D;
    text-align: center;
    margin-bottom: 32px;
}

.download-modal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.download-modal-form input {
    padding: 14px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.download-modal-form input:focus {
    outline: none;
    border-color: #6BA4E8;
}

.download-modal-form button {
    padding: 14px;
    background: #6BA4E8;
    color: #ffffff;
    border: none;
    border-radius: 24px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.download-modal-form button:hover {
    background: #5A93D7;
}

.download-modal-login {
    text-align: center;
    margin-top: 20px;
    color: #7F8C8D;
}

.download-modal-login a {
    color: #6BA4E8;
    text-decoration: none;
    font-weight: 600;
}

.download-modal-login a:hover {
    text-decoration: underline;
}
