/* ============================================
   СУЧАСНІ ВІДЖЕТИ З АНІМАЦІЯМИ ТА СКРОЛ ПРОГРЕСОМ
   ============================================ */

/* Базові стилі для всіх віджетів */
.widget {
    position: fixed;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #01a0c6 0%, #00c4c9 100%);
    box-shadow: 0 8px 24px rgba(1, 160, 198, 0.3);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    text-decoration: none;
}

.widget:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 32px rgba(1, 160, 198, 0.4);
}

.widget:active {
    transform: translateY(-2px) scale(1.02);
}

/* Іконка всередині віджета */
.widget__icon {
    position: relative;
    z-index: 10;
    width: 32px;
    height: 32px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    pointer-events: none;
}

.widget__icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.widget:hover .widget__icon {
    transform: scale(1.1);
}

/* ============================================
   ВІДЖЕТ: ТЕЛЕФОН (ліворуч внизу)
   ============================================ */
.widget--phone {
    bottom: 30px;
    left: 30px;
    animation: widgetFadeIn 0.6s ease-out;
}

/* Пульсуючі кільця */
.widget--phone .widget__pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: pulseRing 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    z-index: 1;
    pointer-events: none;
}

.widget--phone .widget__pulse-ring--delay {
    animation-delay: 1s;
    width: 80px;
    height: 80px;
    opacity: 0.4;
}

/* Анімація пульсації */
@keyframes pulseRing {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* ============================================
   ВІДЖЕТ: НАВЕРХ (праворуч внизу)
   ============================================ */
.widget--top {
    bottom: 30px;
    right: 30px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.widget--top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    animation: widgetFadeIn 0.6s ease-out;
}

/* Контейнер для скрол прогресу */
.widget--top .widget__scroll-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    z-index: 1;
}

.widget__progress-svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Фоновий коло прогресу */
.widget__progress-circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.3);
    stroke-width: 4;
}

/* Коло прогресу */
.widget__progress-circle {
    fill: none;
    stroke: #ffffff;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 282.74;
    stroke-dashoffset: 282.74;
    transition: stroke-dashoffset 0.15s ease-out;
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.5));
}

/* Анімація появи віджета */
@keyframes widgetFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(20px);
    }
    60% {
        transform: scale(1.1) translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Ефект ripple при кліку */
.widget::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: 2;
    pointer-events: none;
}

.widget:active::after {
    width: 300px;
    height: 300px;
    transition: width 0s, height 0s;
}

/* ============================================
   АДАПТИВНІСТЬ
   ============================================ */
@media screen and (max-width: 768px) {
    .widget {
        width: 50px;
        height: 50px;
    }
    
    .widget--phone {
        bottom: 20px;
        left: 20px;
    }
    
    .widget--top {
        bottom: 20px;
        right: 20px;
    }
    
    .widget__icon {
        width: 28px;
        height: 28px;
    }
    
    .widget--phone .widget__pulse-ring {
        width: 50px;
        height: 50px;
    }
    
    .widget--phone .widget__pulse-ring--delay {
        width: 70px;
        height: 70px;
    }
    
    .widget__progress-circle {
        stroke-width: 3.5;
    }
    
    .widget__progress-circle-bg {
        stroke-width: 3.5;
    }
}

@media screen and (max-width: 480px) {
    .widget {
        width: 45px;
        height: 45px;
    }
    
    .widget--phone {
        bottom: 15px;
        left: 15px;
    }
    
    .widget--top {
        bottom: 15px;
        right: 15px;
    }
    
    .widget__icon {
        width: 26px;
        height: 26px;
    }
}

/* ============================================
   ДОДАТКОВІ АНІМАЦІЇ ТА ЕФЕКТИ
   ============================================ */

/* Плавна анімація при наведенні */
.widget--phone:hover .widget__pulse-ring {
    animation-duration: 1.5s;
}

/* Ефект світіння */
.widget::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: linear-gradient(135deg, #01a0c6 0%, #00c4c9 100%);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.widget:hover::before {
    opacity: 0.3;
    filter: blur(8px);
}

/* Плавна зміна кольору при наведенні */
.widget {
    background: linear-gradient(135deg, #01a0c6 0%, #00c4c9 100%);
}

.widget:hover {
    background: linear-gradient(135deg, #00c4c9 0%, #01a0c6 100%);
}

/* Додаткові стилі для кращої видимості прогресу */
.widget--top {
    background: rgba(1, 160, 198, 0.85);
    backdrop-filter: blur(10px);
}

.widget--top:hover {
    background: rgba(0, 196, 201, 0.9);
}

