/**
 * Language Banner Styles
 *
 * Bottom bar with slide-up animation, RTL support, and mobile responsiveness.
 * Brand colors: #1a1a1a background, #f1f1f1 text, #0090ff accent.
 */

/* ==========================================================================
   Banner Container
   ========================================================================== */

.pll-lang-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background-color: #1a1a1a;
    color: #f1f1f1;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.25);
    /* Initial state for slide-up animation */
    transform: translateY(100%);
    transition: transform 300ms ease-out;
}

/* Animated state */
.pll-lang-banner.pll-banner--visible {
    transform: translateY(0);
}

/* Dismiss animation */
.pll-lang-banner.pll-banner--hiding {
    transform: translateY(100%);
    transition: transform 300ms ease-in;
}

/* ==========================================================================
   Flag Image
   ========================================================================== */

.pll-lang-banner__flag {
    width: 24px;
    height: 18px;
    border-radius: 2px;
    flex-shrink: 0;
    object-fit: cover;
}

/* ==========================================================================
   Banner Text
   ========================================================================== */

.pll-lang-banner__text {
    color: #f1f1f1;
    margin: 0;
    white-space: nowrap;
}

/* ==========================================================================
   Switch (CTA) Button
   ========================================================================== */

.pll-lang-banner__switch {
    display: inline-block;
    background-color: #0090ff;
    color: #ffffff;
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 150ms ease;
    line-height: 1.4;
}

.pll-lang-banner__switch:hover,
.pll-lang-banner__switch:focus {
    background-color: #339dff;
    color: #ffffff;
    text-decoration: none;
    outline: none;
}

/* ==========================================================================
   Stay / Dismiss Text Link
   ========================================================================== */

.pll-lang-banner__stay {
    color: #f1f1f1;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 14px;
    font-family: inherit;
    padding: 0;
    white-space: nowrap;
    transition: color 150ms ease;
}

.pll-lang-banner__stay:hover,
.pll-lang-banner__stay:focus {
    color: #ffffff;
    outline: none;
}

/* ==========================================================================
   Close (X) Button
   ========================================================================== */

.pll-lang-banner__close {
    color: #999999;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 0 0 4px;
    margin-left: 4px;
    flex-shrink: 0;
    transition: color 150ms ease;
}

.pll-lang-banner__close:hover,
.pll-lang-banner__close:focus {
    color: #ffffff;
    outline: none;
}

/* ==========================================================================
   RTL Support
   ========================================================================== */

.pll-lang-banner[dir="rtl"] {
    direction: rtl;
}

.pll-lang-banner[dir="rtl"] .pll-lang-banner__close {
    margin-left: 0;
    margin-right: 4px;
    padding: 0 4px 0 0;
}

/* ==========================================================================
   Responsive - Tablet & Mobile
   ========================================================================== */

@media screen and (max-width: 768px) {
    .pll-lang-banner {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        padding: 12px 16px;
        font-size: 14px;
        text-align: center;
    }

    .pll-lang-banner__text {
        white-space: normal;
        flex-basis: calc(100% - 44px); /* Leave room for flag and close */
        text-align: center;
    }

    .pll-lang-banner__switch {
        padding: 8px 16px;
        font-size: 13px;
    }

    .pll-lang-banner__stay {
        font-size: 13px;
    }

    .pll-lang-banner__close {
        position: absolute;
        top: 10px;
        right: 12px;
    }

    .pll-lang-banner[dir="rtl"] .pll-lang-banner__close {
        right: auto;
        left: 12px;
    }

    /* Ensure the banner has relative positioning for the absolute close button */
    .pll-lang-banner {
        position: fixed; /* Keep fixed */
    }
}

@media screen and (max-width: 480px) {
    .pll-lang-banner {
        padding: 12px 14px;
        gap: 8px;
    }

    .pll-lang-banner__flag {
        width: 20px;
        height: 15px;
    }

    .pll-lang-banner__text {
        font-size: 13px;
    }
}
