/* Redesigned Bottom Footer Bar Styles — Horizontal & Glassmorphic */

.vpn-alert-overlay {
    position: fixed;
    bottom: calc(var(--safe-bottom) + var(--space-4));
    left: max(var(--space-4), var(--safe-left));
    right: max(var(--space-4), var(--safe-right));
    transform: translateY(25px);
    z-index: 100000; /* Stays on top of content */
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* Let clicks pass through 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: translateY(0);
}

/* Glassmorphism Bottom Row Bar */
.footer-main-bar {
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: var(--radius-xl);
    padding: var(--space-3) var(--space-4);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.45),
        0 0 20px rgba(45, 212, 191, 0.08);
    position: relative;
    pointer-events: auto; /* Re-enable clicks on the bar */
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    direction: rtl; /* Kurdish RTL */
    transition: transform var(--transition-slow), opacity var(--transition-slow);
}

/* Spring entry scale animation */
.vpn-alert-overlay.is-visible .footer-main-bar {
    transform: scale(1);
    opacity: 1;
    transition: 
        transform 0.52s cubic-bezier(0.34, 1.6, 0.64, 1), 
        opacity 0.35s var(--ease-out);
}

/* Facebook Logo Link & Promo Text Section */
.footer-facebook-section {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex: 1;
    min-width: 0; /* Ensures container can shrink on smaller viewports */
}

.promo-logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.promo-logo-link:hover {
    transform: scale(1.1);
}

.promo-logo {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #1877F2;
    fill: currentColor;
    background: #ffffff;
    box-shadow: 0 0 8px rgba(24, 119, 242, 0.3);
    transition: box-shadow var(--transition-base);
}

.promo-logo-link:hover .promo-logo {
    box-shadow: 0 0 15px rgba(24, 119, 242, 0.6);
}

.footer-promo-text {
    font-size: 0.84rem;
    font-weight: 500;
    color: #cbd5e1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis; /* Gracefully truncate if viewport gets tight on mid-sized screens */
}

/* Vertical Divider between Facebook and Telegram */
.footer-bar-divider {
    width: 1px;
    height: 24px;
    background: rgba(148, 163, 184, 0.2);
    flex-shrink: 0;
}

/* Telegram Section */
.footer-telegram-section {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.footer-telegram-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    background: linear-gradient(135deg, #0088cc 0%, #229ed9 100%);
    color: #ffffff;
    text-decoration: none;
    padding: var(--space-2) var(--space-5);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(0, 136, 204, 0.35);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    min-height: 38px;
}

.footer-telegram-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 136, 204, 0.45);
}

.footer-telegram-icon {
    width: 22px;
    height: 22px;
    fill: currentColor;
    display: block;
    flex-shrink: 0;
}

.footer-telegram-text {
    font-family: var(--font-heading);
    white-space: nowrap;
}

/* Adjust PWA floating download button to float above the footer bar */
.bottom-left-fabs {
    bottom: calc(var(--safe-bottom) + var(--space-4) + 70px) !important;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .footer-promo-text {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .vpn-alert-overlay {
        bottom: calc(var(--safe-bottom) + var(--space-3));
        left: var(--space-3);
        right: var(--space-3);
    }

    .footer-main-bar {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-2.5);
        padding: var(--space-3);
        border-radius: var(--radius-lg);
    }

    .footer-facebook-section {
        width: 100%;
        justify-content: center;
    }

    .footer-promo-text {
        font-size: 0.78rem;
        white-space: normal; /* Allow text wrapping on mobile */
        text-align: center;
        overflow: visible;
        text-overflow: clip;
    }

    .footer-bar-divider {
        display: none; /* Hide vertical divider on mobile */
    }

    .footer-telegram-section {
        width: 100%;
        justify-content: center;
    }

    .footer-telegram-link {
        width: 100%;
        justify-content: center;
        padding: var(--space-2.5);
        font-size: 0.78rem;
    }

    /* Push PWA download button further up on mobile to avoid covering content */
    .bottom-left-fabs {
        bottom: calc(var(--safe-bottom) + var(--space-3) + 125px) !important;
    }
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
    .footer-main-bar {
        transform: none !important;
        transition: none !important;
    }
    .vpn-alert-overlay {
        transition: none !important;
        transform: translateY(0) !important;
    }
}
