/* Плавающая кнопка помощи */
.help-float-button {
    position: fixed;
    right: var(--help-right-offset, 20px);
    bottom: var(--help-bottom-offset, 90px);
    width: var(--help-size, 50px);
    height: var(--help-size, 50px);
    background: var(--help-bg-color, #8b5cf6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9998;
    box-shadow: var(--help-shadow, 0 4px 12px rgba(139, 92, 246, 0.4));
    transition: all 0.3s ease;
    border: none;
    color: var(--help-icon-color, #ffffff);
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
    font-family: Arial, sans-serif;
}

.help-float-button:hover {
    background: var(--help-hover-bg-color, #7c3aed);
    box-shadow: var(--help-hover-shadow, 0 6px 16px rgba(139, 92, 246, 0.6));
    transform: scale(1.1);
}

.help-float-button:active {
    transform: scale(0.95);
}

/* Скрытие кнопки */
.help-float-button.hidden {
    display: none !important;
}

/* Модальное окно с видео */
.help-video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.help-video-modal.active {
    display: flex;
}

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

/* Контейнер видео */
.help-video-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

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

/* Кнопка закрытия */
.help-video-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 36px;
    font-weight: 300;
    cursor: pointer;
    z-index: 10001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0;
    border-radius: 50%;
}

.help-video-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

/* Обертка для iframe (соотношение сторон 16:9) */
.help-video-wrapper {
    position: relative;
    padding-top: 56.25%;
    width: 100%;
}

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

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .help-float-button {
        width: calc(var(--help-size, 50px) * 0.9);
        height: calc(var(--help-size, 50px) * 0.9);
        right: calc(var(--help-right-offset, 20px) * 0.8);
        bottom: calc(var(--help-bottom-offset, 90px) * 0.8);
        font-size: 24px;
    }
    
    .help-video-container {
        max-width: 100%;
        border-radius: 8px;
    }
    
    .help-video-close {
        top: -35px;
        font-size: 30px;
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 480px) {
    .help-video-modal {
        padding: 10px;
    }
    
    .help-video-close {
        top: 10px;
        right: 10px;
        background: rgba(0, 0, 0, 0.7);
    }
}

/* Анимация при закрытии */
.help-video-modal.closing {
    animation: fadeOut 0.3s ease;
}

.help-video-modal.closing .help-video-container {
    animation: slideDown 0.3s ease;
}

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

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