.codeby-tg-widget,
.telegram-widget {
    position: fixed;
    z-index: 9999;
    bottom: 30px;
}

.codeby-tg-widget--right,
.telegram-widget.codeby-tg-widget--right {
    right: 30px;
}

.codeby-tg-widget--left,
.telegram-widget.codeby-tg-widget--left {
    left: 30px;
}

.codeby-tg-widget__button,
.telegram-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    padding: 0;
    border-radius: 50%;
    color: #fff;
    background-color: #0088cc;
    text-decoration: none;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.4);
    transition: all 0.3s ease;
    animation: codeby-tg-pulse 2s infinite;
    line-height: 1;
    cursor: pointer;
}

.codeby-tg-widget__button--icon,
.telegram-button.codeby-tg-widget__button--icon {
    width: 60px;
}

.codeby-tg-widget__icon,
.telegram-icon {
    width: 32px;
    height: 32px;
    display: inline-block;
    background: #ffffff;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z'/%3E%3C/svg%3E") no-repeat center / contain;
    margin: 0;
}

.telegram-icon {
    background: none;
    mask: none;
    fill: #ffffff;
}

.codeby-tg-widget__label {
    display: none;
}

.codeby-tg-widget__tooltip,
.telegram-tooltip {
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--card-bg, #111111);
    color: var(--text-primary, #ffffff);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.codeby-tg-widget__tooltip::after,
.telegram-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: var(--card-bg, #111111);
}

.codeby-tg-widget__button:hover .codeby-tg-widget__tooltip,
.codeby-tg-widget__button:focus-visible .codeby-tg-widget__tooltip,
.telegram-button:hover .telegram-tooltip {
    opacity: 1;
    visibility: visible;
}
.codeby-tg-widget__button:hover,
.telegram-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.5);
    animation: none;
}

.codeby-tg-widget__button:active,
.telegram-button:active {
    transform: scale(0.95);
}

.codeby-tg-widget__button:disabled,
.codeby-tg-widget__button.codeby-tg-widget__button--loading {
    opacity: 0.75;
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.25);
    cursor: progress;
}

.telegram-button.codeby-tg-widget__button--loading {
    opacity: 0.75;
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.25);
    cursor: progress;
}

.codeby-tg-widget__button:disabled:hover,
.codeby-tg-widget__button.codeby-tg-widget__button--loading:hover,
.telegram-button.codeby-tg-widget__button--loading:hover {
    transform: none;
    animation: codeby-tg-pulse 2s infinite;
}

@keyframes codeby-tg-pulse {
    0% {
        box-shadow: 0 4px 12px rgba(0, 136, 204, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(0, 136, 204, 0.6), 0 0 0 8px rgba(0, 136, 204, 0.1);
    }
    100% {
        box-shadow: 0 4px 12px rgba(0, 136, 204, 0.4);
    }
}

@media (prefers-reduced-motion: reduce) {
    .codeby-tg-widget__button {
        animation: none;
    }
}

@media (max-width: 768px) {
    .codeby-tg-widget,
    .telegram-widget {
        bottom: 20px;
    }

    .codeby-tg-widget--right,
    .telegram-widget.codeby-tg-widget--right {
        right: 20px;
    }

    .codeby-tg-widget--left,
    .telegram-widget.codeby-tg-widget--left {
        left: 20px;
    }

    .codeby-tg-widget__button,
    .codeby-tg-widget__button--icon,
    .telegram-button {
        width: 50px;
        height: 50px;
    }

    .codeby-tg-widget__icon,
    .telegram-icon {
        width: 26px;
        height: 26px;
    }

    .codeby-tg-widget__tooltip,
    .telegram-tooltip {
        display: none;
    }
}
