/**
 * Telegram Popup Styles
 */

/* Widget Container */
.telegram-popup-widget {
    position: fixed;
    z-index: 9998;
}

.telegram-popup-widget.position-bottom-left {
    bottom: 240px;
    left: 25px;
}

.telegram-popup-widget.position-bottom-right {
    bottom: 240px;
    right: 20px;
}

.telegram-popup-widget.position-top-left {
    top: 100px;
    left: 25px;
}

.telegram-popup-widget.position-top-right {
    top: 100px;
    right: 25px;
}

/* Floating Button */
.telegram-popup-button {
    position: relative;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    animation: pulse-glow 3s ease-in-out infinite;
}

.telegram-popup-button:hover {
    transform: scale(1.05) rotate(15deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    animation: none;
}

.telegram-popup-button:active {
    transform: scale(0.95) rotate(0deg);
}

@keyframes pulse-glow {
    0%,
    100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 0 rgba(124, 77, 255, 0.7);
    }
    50% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 20px 10px rgba(124, 77, 255, 0);
    }
}

.telegram-icon {
    pointer-events: none;
}

/* Badge */
.telegram-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: #ff1744;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 10px;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    line-height: 1;
    min-width: 20px;
    text-align: center;
}

/* Modal Overlay */
.telegram-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.telegram-popup-overlay.active {
    opacity: 1;
}

/* Snow Particles Effect */
.telegram-popup-overlay.active::before,
.telegram-popup-overlay.active::after {
    content: "";
    position: absolute;
    top: -10%;
    left: 0;
    width: 100%;
    height: 110%;
    pointer-events: none;
    background-image: radial-gradient(2px 2px at 20% 30%, white, transparent), radial-gradient(2px 2px at 60% 70%, white, transparent), radial-gradient(1px 1px at 50% 50%, white, transparent), radial-gradient(1px 1px at 80% 10%, white, transparent), radial-gradient(2px 2px at 90% 60%, white, transparent), radial-gradient(1px 1px at 33% 80%, white, transparent),
        radial-gradient(1px 1px at 66% 25%, white, transparent);
    background-size: 200px 200px, 300px 300px, 250px 250px, 280px 280px, 320px 320px, 260px 260px, 290px 290px;
    background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0;
    animation: snowfall 20s linear infinite;
    opacity: 0.6;
}

.telegram-popup-overlay.active::after {
    background-image: radial-gradient(1px 1px at 40% 20%, white, transparent), radial-gradient(2px 2px at 70% 80%, white, transparent), radial-gradient(1px 1px at 25% 60%, white, transparent), radial-gradient(1px 1px at 85% 40%, white, transparent), radial-gradient(2px 2px at 15% 90%, white, transparent), radial-gradient(1px 1px at 55% 15%, white, transparent);
    background-size: 220px 220px, 310px 310px, 270px 270px, 330px 330px, 240px 240px, 300px 300px;
    animation-duration: 25s;
    animation-delay: -10s;
    opacity: 0.4;
}

@keyframes snowfall {
    0% {
        background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0;
    }
    100% {
        background-position: 0 200px, 0 300px, 0 250px, 0 280px, 0 320px, 0 260px, 0 290px;
    }
}

/* Modal */
.telegram-popup-modal {
    position: relative;
    max-width: 500px;
    width: 100%;
    background: linear-gradient(135deg, #7c4dff 0%, #8b5cf6 35%, #9575ff 70%, #a68aff 100%);
    border-radius: 24px;
    padding: 50px 40px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.8) translateY(20px);
    transition: transform 0.3s ease;
    text-align: center;
}

.telegram-popup-overlay.active .telegram-popup-modal {
    transform: scale(1) translateY(0);
}

/* Close Button */
.telegram-popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    outline: none;
    box-shadow: none;
}

.telegram-popup-close:hover,
.telegram-popup-close:focus {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
    outline: none;
    box-shadow: none;
}

/* Content */
.telegram-popup-content {
    color: white;
}

.telegram-popup-title {
    font-size: 42px;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.3;
    color: white;
}

.telegram-popup-subtitle {
    font-size: 18px;
    font-weight: 400;
    margin: 0 0 20px;
    opacity: 0.9;
}

.telegram-popup-discount {
    font-size: 120px;
    font-weight: 900;
    line-height: 1;
    margin: 20px 0;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.telegram-popup-discount-label {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 30px;
    text-transform: lowercase;
}

/* Subscribe Button */
.telegram-popup-subscribe-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: white;
    color: #7c4dff;
    font-size: 18px;
    font-weight: 700;
    padding: 16px 48px;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 0 0 20px;
}

.telegram-popup-subscribe-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    color: #7c4dff;
}

.telegram-popup-subscribe-btn svg {
    width: 24px;
    height: 24px;
}

/* Details Link */
.telegram-popup-details-link {
    display: inline-block;
    color: white;
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
    margin: 0 0 20px;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.telegram-popup-details-link:hover {
    opacity: 1;
    color: white;
}

/* Disclaimer */
.telegram-popup-disclaimer {
    font-size: 11px;
    line-height: 1.4;
    opacity: 0.7;
    margin: 0;
    font-style: italic;
}

/* Collapsible Rules Section */
.telegram-popup-rules {
    margin: 0 0 20px 0;
    text-align: center;
}

.telegram-popup-rules-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    width: auto;
    max-width: 180px;
    outline: none;
    box-shadow: none;
    height: auto;
    line-height: normal;
}

.telegram-popup-rules-toggle:hover,
.telegram-popup-rules-toggle:focus {
    background: rgba(255, 255, 255, 0.25);
    outline: none;
    box-shadow: none;
}

.telegram-popup-rules-toggle .toggle-text::after {
    content: "";
    display: inline-block;
    margin-left: 8px;
}

.telegram-popup-rules.active .telegram-popup-rules-toggle .toggle-text::after {
    content: "";
}

.telegram-popup-rules-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, margin-top 0.4s ease, padding 0.4s ease;
    margin-top: 0;
    padding: 0 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
}

.telegram-popup-rules.active .telegram-popup-rules-content {
    max-height: 400px;
    margin-top: 20px;
    padding: 20px;
}

.rules-title {
    color: white;
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 15px;
    text-align: left;
}

.rules-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    text-align: left;
}

.rules-list li {
    color: white;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 10px;
    padding-left: 0;
}

.rules-bot-info {
    color: white;
    font-size: 14px;
    text-align: center;
    opacity: 0.9;
    margin: 15px 0 0;
}

.rules-bot-info strong {
    font-weight: 700;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .telegram-popup-widget.position-bottom-left,
    .telegram-popup-widget.position-bottom-right {
        bottom: 230px;
        right: 20px;
        left: auto;
    }

    .telegram-popup-button {
        width: 60px;
        height: 60px;
    }

    .telegram-icon {
        width: 28px;
        height: 28px;
    }

    .telegram-badge {
        font-size: 9px;
        padding: 2px 5px;
        border-width: 1.5px;
        line-height: 1;
    }

    .telegram-popup-modal {
        padding: 40px 24px 24px;
        border-radius: 16px;
    }

    .telegram-popup-title {
        font-size: 36px;
    }

    .telegram-popup-subtitle {
        font-size: 16px;
    }

    .telegram-popup-discount {
        font-size: 80px;
        margin: 15px 0;
    }

    .telegram-popup-discount-label {
        font-size: 24px;
        margin: 0 0 20px;
    }

    .telegram-popup-subscribe-btn {
        font-size: 16px;
        padding: 14px 36px;
    }

    .telegram-popup-close {
        width: 36px;
        height: 36px;
        top: 16px;
        right: 16px;
    }

    .telegram-popup-close svg {
        width: 24px;
        height: 24px;
    }
}
