/* 
 * Tutorial Video Button - Floating Top Right
 * Modal overlay with video
 */

/* Botón flotante superior derecho */
.tutorial-floating-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.tutorial-floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

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

.tutorial-floating-btn .icon {
    font-size: 28px;
    line-height: 1;
}

/* Tooltip en hover */
.tutorial-floating-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.tutorial-floating-btn:hover::after {
    opacity: 1;
}

/* Modal overlay */
.tutorial-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.tutorial-modal-overlay.active {
    display: flex;
}

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

/* Modal content */
.tutorial-modal {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

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

/* Header del modal */
.tutorial-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tutorial-modal-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tutorial-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.tutorial-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Body del modal */
.tutorial-modal-body {
    padding: 0;
    background: #1a1a1a;
}

.tutorial-description {
    padding: 20px 24px;
    font-size: 15px;
    color: #cccccc;
    line-height: 1.6;
    background: #2a2a2a;
}

.tutorial-video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    background: #000000;
}

.tutorial-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tutorial-modal {
        width: 95%;
        max-height: 85vh;
    }
    
    .tutorial-modal-title {
        font-size: 18px;
    }
    
    .tutorial-floating-btn::after {
        display: none; /* Ocultar tooltip en mobile */
    }
}

@media (max-width: 480px) {
    .tutorial-floating-btn {
        width: 48px;
        height: 48px;
        top: 16px;
        right: 16px;
    }
    
    .tutorial-floating-btn .icon {
        font-size: 24px;
    }
    
    .tutorial-modal-title {
        font-size: 16px;
    }
}

/* Accessibility */
.tutorial-floating-btn:focus {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
}

.tutorial-modal-close:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .tutorial-floating-btn,
    .tutorial-modal-overlay,
    .tutorial-modal,
    .tutorial-modal-close {
        animation: none;
        transition: none;
    }
}

/* Pulse animation para llamar la atención (opcional) */
@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.tutorial-floating-btn.attention::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    animation: pulse-ring 2s infinite;
}
