/* Telegram Style Popunder / Modal Dialog */

.tg-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s ease;
}

.tg-popup-overlay.tg-popup-active {
    opacity: 1;
    visibility: visible;
}

.tg-popup-card {
    background-color: #17212b;
    width: 360px;
    max-width: calc(100vw - 32px);
    box-sizing: border-box;
    border-radius: 14px;
    padding: 24px 22px 20px 22px;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    transform: scale(0.92) translateY(12px);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #ffffff;
    user-select: none;
}

.tg-popup-overlay.tg-popup-active .tg-popup-card {
    transform: scale(1) translateY(0);
}

/* Avatar Container */
.tg-popup-avatar-wrap {
    position: relative;
    width: 86px;
    height: 86px;
    margin: 0 auto 14px auto;
    cursor: pointer;
    border-radius: 50%;
    transition: transform 0.25s ease;
}

.tg-popup-avatar-wrap:hover {
    transform: scale(1.04);
}

.tg-popup-avatar {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

/* Online status indicator dot */
.tg-popup-online-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    background-color: #00c853;
    border: 2.5px solid #17212b;
    border-radius: 50%;
    box-sizing: border-box;
    animation: tgPulse 2s infinite;
}

@keyframes tgPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 200, 83, 0.7);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(0, 200, 83, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 200, 83, 0);
    }
}

/* Title & Subtitle */
.tg-popup-title {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 4px 0;
    line-height: 1.25;
    letter-spacing: -0.2px;
    cursor: pointer;
}

.tg-popup-status {
    font-size: 13.5px;
    color: #4fa651;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 16px 0;
}

.tg-popup-status-dot {
    width: 7px;
    height: 7px;
    background-color: #00c853;
    border-radius: 50%;
    display: inline-block;
}

/* Description / Call to action */
.tg-popup-text {
    font-size: 14.5px;
    line-height: 1.48;
    color: #8da0b1;
    margin: 0 0 22px 0;
    padding: 0 6px;
    text-align: center;
    word-break: break-word;
}

/* Action Buttons Footer */
.tg-popup-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
    gap: 10px;
    margin-top: 4px;
}

.tg-popup-btn {
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    border: none;
    outline: none;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.tg-popup-btn-cancel {
    background: transparent;
    color: #5288c1;
}

.tg-popup-btn-cancel:hover {
    background: rgba(82, 136, 193, 0.12);
    color: #6fb0f5;
}

.tg-popup-btn-action {
    background: #2ea6ff;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(46, 166, 255, 0.35);
}

.tg-popup-btn-action:hover {
    background: #1c9bf5;
    box-shadow: 0 6px 18px rgba(46, 166, 255, 0.48);
    transform: translateY(-1px);
    color: #ffffff;
}

.tg-popup-btn-action:active {
    transform: translateY(0);
}

/* Telegram icon inside action button */
.tg-popup-btn-action svg {
    width: 17px;
    height: 17px;
    margin-right: 6px;
    fill: currentColor;
}

/* Close button on top-right (optional convenience) */
.tg-popup-close-x {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 26px;
    height: 26px;
    background: transparent;
    border: none;
    color: #6c7883;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: color 0.2s, background 0.2s;
    line-height: 1;
}

.tg-popup-close-x:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}
