/* Messenger Widget Styles - Упрощенный вид */

/* Контейнер виджета */
#messengerWidgetContainer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: flex-end;
}

/* Кнопки мессенджеров */
.messenger-widget-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none !important;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: fadeInUp 0.5s ease-out;
    animation-fill-mode: both;
}

/* Анимация появления кнопок */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Задержки для последовательного появления */
.messenger-widget-btn:nth-child(1) {
    animation-delay: 0.1s;
}

.messenger-widget-btn:nth-child(2) {
    animation-delay: 0.2s;
}

.messenger-widget-btn:nth-child(3) {
    animation-delay: 0.3s;
}

.messenger-widget-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.messenger-widget-btn:active {
    transform: scale(0.95);
}

.messenger-widget-btn svg {
    width: 32px;
    height: 32px;
}

.messenger-widget-btn svg path {
    fill: #fff !important;
}

/* Кнопка звонка */
#phoneWidgetBtn {
    background: linear-gradient(135deg, #FF6B6B 0%, #EE5A6F 100%) !important;
}

#phoneWidgetBtn:hover {
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

/* Кнопка WhatsApp */
#whatsappWidgetBtn {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%) !important;
}

#whatsappWidgetBtn:hover {
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

/* Кнопка Telegram */
#telegramWidgetBtn {
    background: linear-gradient(135deg, #0088cc 0%, #0066aa 100%) !important;
}

#telegramWidgetBtn:hover {
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4);
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    #messengerWidgetContainer {
        bottom: 15px;
        right: 15px;
        gap: 12px;
    }
    
    .messenger-widget-btn {
        width: 50px;
        height: 50px;
    }
    
    .messenger-widget-btn svg {
        width: 26px;
        height: 26px;
    }
}

/* Адаптивность для маленьких экранов */
@media (max-width: 480px) {
    #messengerWidgetContainer {
        bottom: 10px;
        right: 10px;
        gap: 10px;
    }
    
    .messenger-widget-btn {
        width: 45px;
        height: 45px;
    }
    
    .messenger-widget-btn svg {
        width: 24px;
        height: 24px;
    }
}

/* Поддержка старых браузеров */
.messenger-widget-btn {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
    
    -webkit-transform: translateZ(0);
    -moz-transform: translateZ(0);
    -ms-transform: translateZ(0);
    -o-transform: translateZ(0);
    transform: translateZ(0);
    
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
}

/* Keyframes для WebKit */
@-webkit-keyframes fadeInUp {
    from {
        opacity: 0;
        -webkit-transform: translateY(20px);
    }
    to {
        opacity: 1;
        -webkit-transform: translateY(0);
    }
}

/* Keyframes для Mozilla */
@-moz-keyframes fadeInUp {
    from {
        opacity: 0;
        -moz-transform: translateY(20px);
    }
    to {
        opacity: 1;
        -moz-transform: translateY(0);
    }
}

/* Фикс для IE */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    #messengerWidgetContainer {
        display: block;
    }
    
    .messenger-widget-btn {
        margin-bottom: 15px;
    }
    
    .messenger-widget-btn:last-child {
        margin-bottom: 0;
    }
}

/* Модальное окно */
#messengerModalOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

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

#messengerModal {
    background: #fff;
    border-radius: 16px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: slideUp 0.3s ease;
}

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

/* Кнопка закрытия */
#messengerModalClose {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    font-size: 28px;
    line-height: 28px;
    text-align: center;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
    background: none;
    border: none;
}

#messengerModalClose:hover {
    color: #333;
}

/* Заголовок */
#messengerModalTitle {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Контейнер кнопок */
#messengerModalButtons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Кнопки мессенджеров */
.messenger-contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #fff;
    border: none;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.messenger-contact-btn:hover {
    transform: translateY(-2px);
    color: #fff;
    text-decoration: none;
}

.messenger-contact-btn:active {
    transform: translateY(0);
}

/* WhatsApp кнопка */
#whatsappContactBtn {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

#whatsappContactBtn:hover {
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

/* Telegram кнопка */
#telegramContactBtn {
    background: linear-gradient(135deg, #0088cc 0%, #0066aa 100%);
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.3);
}

#telegramContactBtn:hover {
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.4);
}

/* SVG иконки */
.messenger-contact-btn svg {
    flex-shrink: 0;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    #messengerFloatingBtn {
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
    }
    
    #messengerFloatingBtn::before {
        top: -4px;
        left: -4px;
        right: -4px;
        bottom: -4px;
    }
    
    #messengerFloatingBtn svg {
        width: 24px;
        height: 24px;
    }
    
    #messengerModal {
        padding: 20px;
        max-width: 95%;
    }
    
    #messengerModalTitle {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .messenger-contact-btn {
        padding: 14px 20px;
        font-size: 15px;
    }
}

/* Адаптивность для маленьких экранов */
@media (max-width: 480px) {
    #messengerModal {
        padding: 15px;
    }
    
    #messengerModalTitle {
        font-size: 18px;
    }
    
    .messenger-contact-btn {
        padding: 12px 16px;
        font-size: 14px;
        gap: 8px;
    }
    
    .messenger-contact-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* Поддержка старых браузеров */
#messengerFloatingBtn,
#messengerModal,
.messenger-contact-btn {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

#messengerFloatingBtn {
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
    
    -webkit-transform: translateZ(0);
    -moz-transform: translateZ(0);
    -ms-transform: translateZ(0);
    -o-transform: translateZ(0);
    transform: translateZ(0);
    
    -webkit-animation: switchMessenger 4s ease-in-out infinite;
    -moz-animation: switchMessenger 4s ease-in-out infinite;
    -o-animation: switchMessenger 4s ease-in-out infinite;
    animation: switchMessenger 4s ease-in-out infinite;
}

/* Keyframes для WebKit */
@-webkit-keyframes switchMessenger {
    0%, 45% {
        background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    }
    50%, 95% {
        background: linear-gradient(135deg, #0088cc 0%, #0066aa 100%);
        box-shadow: 0 4px 12px rgba(0, 136, 204, 0.4);
    }
    100% {
        background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    }
}

/* Keyframes для Mozilla */
@-moz-keyframes switchMessenger {
    0%, 45% {
        background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    }
    50%, 95% {
        background: linear-gradient(135deg, #0088cc 0%, #0066aa 100%);
        box-shadow: 0 4px 12px rgba(0, 136, 204, 0.4);
    }
    100% {
        background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
        box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
    }
}

#messengerModalOverlay {
    -webkit-animation: fadeIn 0.3s ease;
    -moz-animation: fadeIn 0.3s ease;
    -o-animation: fadeIn 0.3s ease;
    animation: fadeIn 0.3s ease;
}

#messengerModal {
    -webkit-animation: slideUp 0.3s ease;
    -moz-animation: slideUp 0.3s ease;
    -o-animation: slideUp 0.3s ease;
    animation: slideUp 0.3s ease;
    
    -webkit-border-radius: 16px;
    -moz-border-radius: 16px;
    border-radius: 16px;
}

.messenger-contact-btn {
    -webkit-border-radius: 12px;
    -moz-border-radius: 12px;
    border-radius: 12px;
}

/* Фикс для IE */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    #messengerModalButtons {
        display: block;
    }
    
    .messenger-contact-btn {
        margin-bottom: 12px;
    }
    
    .messenger-contact-btn:last-child {
        margin-bottom: 0;
    }
}