/* Основной контейнер виджета */
.fmw-widget {
    position: fixed;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    pointer-events: none; /* Чтобы не перекрывать клики в закрытом состоянии */
}

/* Позиции */
.fmw-position-bottom-right {
    bottom: 25px;
    right: 25px;
}
.fmw-position-bottom-left {
    bottom: 25px;
    left: 25px;
}
.fmw-position-top-right {
    top: 25px;
    right: 25px;
}
.fmw-position-top-left {
    top: 25px;
    left: 25px;
}

/* Кнопка-переключатель (главная кнопка) */
.fmw-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
    transition: all 0.3s ease;
    position: relative;
    z-index: 2;
}
.fmw-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}
.fmw-toggle:active {
    transform: scale(0.98);
}
.fmw-toggle-icon {
    font-size: 28px;
    color: white;
    line-height: 1;
}

/* Контейнер для иконок мессенджеров */
.fmw-icons-wrapper {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 15px;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1;
}

/* Расположение иконок относительно главной кнопки */
.fmw-position-bottom-right .fmw-icons-wrapper,
.fmw-position-top-right .fmw-icons-wrapper {
    right: 0;
    bottom: 75px;
    align-items: flex-end;
}
.fmw-position-bottom-left .fmw-icons-wrapper,
.fmw-position-top-left .fmw-icons-wrapper {
    left: 0;
    bottom: 75px;
    align-items: flex-start;
}
.fmw-position-top-right .fmw-icons-wrapper {
    bottom: auto;
    top: 75px;
}
.fmw-position-top-left .fmw-icons-wrapper {
    bottom: auto;
    top: 75px;
}

/* Состояние "открыто" */
.fmw-widget.fmw-opened {
    pointer-events: auto;
}
.fmw-widget.fmw-opened .fmw-icons-wrapper {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* Отдельные иконки мессенджеров */
.fmw-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    text-decoration: none;
    pointer-events: auto;
    position: relative;
}
.fmw-icon:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}
.fmw-icon img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

/* Цветовые акценты при наведении */
.fmw-telegram:hover {
    background: #0088cc;
}
.fmw-whatsapp:hover {
    background: #25D366;
}
.fmw-max:hover {
    background: #00B2FF;
}

/* Подсказки (Tooltips) */
.fmw-icon[title]::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    margin-bottom: 8px;
    z-index: 10;
}
.fmw-icon[title]::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.85);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    margin-bottom: -2px;
    z-index: 10;
}
.fmw-icon:hover[title]::after,
.fmw-icon:hover[title]::before {
    opacity: 1;
    visibility: visible;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .fmw-toggle {
        width: 56px;
        height: 56px;
    }
    .fmw-icon {
        width: 48px;
        height: 48px;
    }
    .fmw-toggle-icon {
        font-size: 26px;
    }
    .fmw-position-bottom-right,
    .fmw-position-bottom-left {
        bottom: 20px;
    }
    .fmw-position-top-right,
    .fmw-position-top-left {
        top: 20px;
    }
}