/* WeMake Video Widget — OctoberCMS Plugin */

.vw-video-widget {
    position: fixed;
    top: var(--vw-position-top);
    bottom: var(--vw-position-bottom);
    left: var(--vw-position-left);
    right: var(--vw-position-right);
    /* Выше форм (subscribe/contact: 10050), ниже шапки и моб. меню (10200 / 20000) */
    z-index: 10180;
    /* iPhone: не уезжать под home indicator / вырез */
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    padding-top: env(safe-area-inset-top, 0px);
    /* Коробка только под контейнер виджета — не растягивать весь вьюпорт при сбое inset */
    width: max-content;
    height: max-content;
    max-width: 100vw;
    max-height: 100vh;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.vw-video-widget.vw-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.vw-video-widget-container {
    position: relative;
    width: var(--vw-widget-width, 168px);
    height: var(--vw-widget-height, 280px);
    border-radius: var(--vw-border-radius, 16px);
    overflow: hidden;
    background: #000;
    border: 2px solid var(--vw-border-color, #00abbc);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: all;
}

.vw-video-widget-container.vw-expanded {
    width: var(--vw-expanded-width, 280px);
    height: var(--vw-expanded-height, 500px);
    border-width: 3px;
}

.vw-video-widget-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 11;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.vw-video-widget-container.vw-expanded .vw-video-widget-progress {
    opacity: 1;
}

.vw-video-widget-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #007a8a 0%, #00b4c6 100%);
    width: 0%;
    transition: width 0.1s linear;
    box-shadow: 0 0 8px rgba(0, 171, 188, 0.6);
}

.vw-video-widget-controls {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 6px;
    z-index: 10;
}

.vw-video-widget-control {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0;
}

.vw-video-widget-control:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.vw-video-widget-control svg {
    width: 18px;
    height: 18px;
}

.vw-video-widget-control.vw-video-widget-close {
    opacity: 0.5;
    background: rgba(0, 0, 0, 0.4);
}

.vw-video-widget-control.vw-video-widget-close:hover {
    opacity: 0.8;
    background: rgba(0, 0, 0, 0.6);
}

.vw-video-widget-container.vw-expanded .vw-video-widget-control.vw-video-widget-mute {
    opacity: 0.5;
    background: rgba(0, 0, 0, 0.4);
}

.vw-video-widget-container.vw-expanded .vw-video-widget-control.vw-video-widget-mute:hover {
    opacity: 0.8;
    background: rgba(0, 0, 0, 0.6);
}

.vw-video-widget-player {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.vw-video-widget-button {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    opacity: 0;
    animation: vw-fadeInUp 0.3s ease forwards;
}

@keyframes vw-fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.vw-video-widget-button-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--vw-cta-bg, #25d366);
    color: #fff;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: all 0.2s ease;
}

.vw-video-widget-button-link:hover {
    filter: brightness(0.9);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
    color: #fff;
    text-decoration: none;
}

.vw-video-widget-button-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.vw-video-widget-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10;
    display: none;
    align-items: center;
    justify-content: center;
}

.vw-video-widget-container.vw-expanded .vw-video-widget-footer {
    display: flex;
}

.vw-video-widget-footer-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    font-weight: 500;
    text-align: center;
}

.vw-video-widget-footer-link {
    color: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    display: block;
    width: 100%;
    cursor: pointer;
    line-height: 1.3;
}

.vw-video-widget-footer-link:hover {
    color: #fff;
    text-decoration: underline;
}

.vw-video-widget.vw-hidden {
    display: none;
}

@media (max-width: 768px) {
    .vw-video-widget-container {
        width: var(--vw-mobile-width, 100px);
        height: var(--vw-mobile-height, 160px);
        box-shadow: none;
    }

    .vw-video-widget-container.vw-expanded {
        width: var(--vw-mobile-expanded-width, 240px);
        height: var(--vw-mobile-expanded-height, 400px);
    }

    .vw-video-widget-control {
        width: 28px;
        height: 28px;
    }

    .vw-video-widget-control svg {
        width: 16px;
        height: 16px;
    }

    .vw-video-widget-button-link {
        padding: 10px 16px;
        font-size: 13px;
    }
}
