/* Главный контейнер виджета */
.uvb-wrapper {
    position: fixed;
    z-index: 99999;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    overflow: hidden;
    background: #000;
}

/* Формы */
.uvb-wrapper.is-circle {
    width: var(--uvb-compact-size, 120px);
    height: var(--uvb-compact-size, 120px);
    border-radius: 50%;
}

.uvb-wrapper.is-rounded {
    width: var(--uvb-compact-size, 120px);
    height: calc(var(--uvb-compact-size, 120px) * 1.33);
    border-radius: 20px;
}

/* Видео */
.uvb-video-container {
    position: relative;
    width: 100%;
    height: 100%;
}

#uvb-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

#uvb-video-wrapper {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    overflow: hidden;
}

#uvb-video-wrapper iframe {
    position: absolute;
    top: 50%; left: 50%;
    width: 300%; height: 100%; /* Wider than container to hide black bars from YT */
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* Shorts — вертикальный формат, заполняем круг по высоте */
.uvb-is-shorts:not(.expanded) #uvb-video-wrapper iframe {
    width: 100%;
    height: 300%;
}

#uvb-wrapper.expanded #uvb-video-wrapper,
#uvb-wrapper.expanded #uvb-video {
    pointer-events: auto;
}

/* Развернутое состояние */
.uvb-wrapper.expanded {
    width: var(--uvb-expanded-w, 350px);
    height: var(--uvb-expanded-h, 500px);
    border-radius: 20px;
    cursor: default;
}

/* Overlay с кнопками */
.uvb-overlay {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background: linear-gradient(transparent, rgba(0,0,0,0.8)) !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease;
    display: flex !important;
    flex-direction: column !important;
    gap: var(--uvb-btn-gap, 10px) !important;
}

.uvb-wrapper.expanded .uvb-overlay.is-visible {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Кнопки CTA */
.uvb-btn {
    text-decoration: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 600 !important;
    transition: transform 0.2s ease, filter 0.2s ease !important;
    width: 100% !important;
    text-align: center !important;
}

/* Убираем марджин у последней кнопки */
.uvb-btn:last-child {
    margin-bottom: 0 !important;
}

.uvb-btn:hover {
    transform: translateY(-2px) !important;
    filter: brightness(1.1) !important;
}

/* Фикс иконок для всех кнопок */
.uvb-wrapper .dashicons:before {
    display: inline-block !important;
    font-family: dashicons !important;
    text-decoration: inherit !important;
    font-weight: normal !important;
    font-style: normal !important;
    vertical-align: top !important;
    text-align: center !important;
    transition: color .1s ease-in 0s !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Принудительные коды иконок для контролов */
#uvb-close .dashicons:before { content: "\f335" !important; }
#uvb-mute .dashicons-controls-volume-off:before { content: "\f506" !important; }
#uvb-mute .dashicons-controls-volume-on:before { content: "\f504" !important; }

/* Иконки SVG */
.uvb-control-btn svg {
    width: 22px !important;
    height: 22px !important;
    stroke: #ffffff !important;
    fill: none !important;
    display: block !important;
}

/* Скрытие иконок по умолчанию */
#uvb-mute-new .uvb-icon-mute, 
#uvb-mute-new .uvb-icon-unmute { 
    display: none !important; 
}

/* Состояние: звук выключен (is-muted) - показываем перечеркнутый динамик */
#uvb-mute-new.is-muted .uvb-icon-mute { 
    display: block !important; 
}

/* Состояние: звук включен (not is-muted) - показываем обычный динамик */
#uvb-mute-new:not(.is-muted) .uvb-icon-unmute { 
    display: block !important; 
}

/* Контролы (Закрыть, Звук) */
.uvb-controls {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100 !important;
}

.uvb-wrapper.expanded .uvb-controls {
    opacity: 1 !important;
    visibility: visible !important;
}

.uvb-control-btn {
    background: rgba(0,0,0,0.6) !important;
    border: none !important;
    color: #fff !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
    backdrop-filter: blur(5px) !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2) !important;
}

#uvb-close {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#uvb-close.is-visible {
    opacity: 1 !important;
    visibility: visible !important;
}

.uvb-control-btn:hover {
    background: rgba(0,0,0,0.9) !important;
    transform: scale(1.1) !important;
}

.uvb-control-btn .dashicons {
    font-size: 22px !important;
    width: 22px !important;
    height: 22px !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .uvb-wrapper.expanded {
        width: calc(100% - 40px) !important;
        height: 75vh !important;
        bottom: 20px !important;
        right: 20px !important;
    }
}
