/* VPN Alert Overlay - Glassmorphic & Ultra Premium Bottom Notification Design */

body.has-vpn-alert {
    /* No scroll-locking! Allow scrolling freely */
}

.vpn-alert-overlay {
    position: fixed;
    bottom: var(--space-6);
    left: 50%;
    transform: translateX(-50%) translateY(40px);
    width: calc(100% - var(--space-8));
    max-width: 540px;
    z-index: 100000; /* Must be on top of all elements including footer/telegram fab */
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* Let clicks pass through the overlay container */
    transition: opacity var(--transition-slow), visibility var(--transition-slow), transform var(--transition-slow);
}

.vpn-alert-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Glassmorphism Alert Box */
.vpn-alert-box {
    background: linear-gradient(145deg, rgba(26, 46, 40, 0.9) 0%, rgba(15, 31, 28, 0.95) 100%);
    border: 1.5px solid var(--color-border-strong);
    border-radius: var(--radius-lg);
    padding: var(--space-2) var(--space-4);
    width: 100%;
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.35),
        var(--shadow-glow-primary);
    position: relative;
    pointer-events: auto; /* Re-enable click/interaction on the alert card itself */
    display: flex;
    align-items: center;
    gap: var(--space-3);
    transition: transform var(--transition-slow), opacity var(--transition-slow);
}

/* Make it spring up when visible */
.vpn-alert-overlay.is-visible .vpn-alert-box {
    transform: scale(1) translateY(0);
    opacity: 1;
    transition: 
        transform 0.48s cubic-bezier(0.34, 1.56, 0.64, 1), 
        opacity 0.38s var(--ease-out);
}

/* Decorative Outer Spin & Inner Pulse Icon */
.vpn-alert-icon-wrap {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.15) 0%, rgba(13, 148, 136, 0.25) 100%);
    border: 1.5px solid var(--color-primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    color: var(--color-primary);
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.15);
}

.vpn-alert-icon-wrap::before {
    content: '';
    position: absolute;
    inset: -3px;
    border: 1px dashed rgba(45, 212, 191, 0.35);
    border-radius: var(--radius-full);
    animation: vpn-spin 25s linear infinite;
}

.vpn-alert-icon-pulse {
    position: absolute;
    inset: -2px;
    border-radius: var(--radius-full);
    box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.4);
    animation: vpn-pulse-glow 2.2s cubic-bezier(0.25, 0, 0, 1) infinite;
    pointer-events: none;
}

@keyframes vpn-pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.5);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(45, 212, 191, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(45, 212, 191, 0);
    }
}

@keyframes vpn-spin {
    to {
        transform: rotate(360deg);
    }
}

.vpn-alert-icon svg {
    width: 16px;
    height: 16px;
    filter: drop-shadow(0 0 4px rgba(45, 212, 191, 0.6));
    animation: vpn-bounce 3s ease-in-out infinite;
}

@keyframes vpn-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

/* Alert Content wrapper */
.vpn-alert-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    text-align: right; /* RTL direction alignment */
}

/* Typography styling */
.vpn-alert-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
    font-family: var(--font-heading);
    letter-spacing: 0.2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.vpn-alert-message {
    font-size: 0.8rem;
    line-height: 1.35;
    color: var(--color-text-muted);
    font-family: var(--font-body);
    margin: 0;
    font-weight: 500;
}

/* Interactive Close Button */
.vpn-alert-btn {
    background: var(--gradient-primary);
    color: #042f2e;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    transition: all var(--transition-base);
    box-shadow: 
        0 3px 8px rgba(45, 212, 191, 0.18),
        var(--shadow-glow-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-family: var(--font-body);
    flex-shrink: 0;
    white-space: nowrap;
}

.vpn-alert-btn:hover {
    background: var(--gradient-primary-hover);
    transform: translateY(-1px);
    box-shadow: 
        0 5px 12px rgba(45, 212, 191, 0.3),
        0 0 12px rgba(45, 212, 191, 0.15);
}

.vpn-alert-btn:active {
    transform: translateY(-0.5px);
    box-shadow: 0 3px 6px rgba(45, 212, 191, 0.1);
}

/* Mobile Responsiveness styling */
@media (max-width: 576px) {
    .vpn-alert-overlay {
        bottom: var(--space-4);
        width: calc(100% - var(--space-4));
    }
    
    .vpn-alert-box {
        flex-direction: row;
        align-items: center;
        padding: 0.45rem 0.65rem;
        gap: 0.5rem;
    }
    
    .vpn-alert-icon-wrap {
        width: 28px;
        height: 28px;
        box-shadow: 0 0 6px rgba(45, 212, 191, 0.1);
    }
    
    .vpn-alert-icon-wrap::before {
        inset: -2px;
    }
    
    .vpn-alert-icon svg {
        width: 13px;
        height: 13px;
    }
    
    .vpn-alert-content {
        text-align: right;
    }
    
    .vpn-alert-title {
        font-size: 0.85rem;
    }
    
    .vpn-alert-message {
        font-size: 0.72rem;
        line-height: 1.25;
    }
    
    .vpn-alert-btn {
        font-size: 0.72rem;
        padding: 0.3rem 0.55rem;
        border-radius: var(--radius-sm);
    }
}

/* For users with prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .vpn-alert-box {
        transform: none !important;
        transition: none !important;
    }
    .vpn-alert-icon-wrap::before,
    .vpn-alert-icon-pulse,
    .vpn-alert-icon svg {
        animation: none !important;
    }
    .vpn-alert-overlay {
        transition: none !important;
        transform: translateX(-50%) !important;
    }
}
