/* Geo Language Switcher — Popup Styles */

/* ── Overlay backdrop ───────────────────────────────────────────────────── */
.gls-pl-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;

    /* Entrance animation */
    opacity: 0;
    transition: opacity 0.25s ease;
}

.gls-pl-overlay.gls-pl-visible {
    opacity: 1;
}

/* ── Popup card ─────────────────────────────────────────────────────────── */
.gls-pl-popup {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    max-width: 480px;
    width: 100%;
    padding: 32px 28px 28px;
    box-sizing: border-box;
    position: relative;
    /* Slide-up entrance */
    transform: translateY(20px);
    transition: transform 0.25s ease;
}

/* Scroll happens inside the site list, not on the card itself —
   this preserves the border-radius on the popup card. */


.gls-pl-overlay.gls-pl-visible .gls-pl-popup {
    transform: translateY(0);
}

/* ── Close button ───────────────────────────────────────────────────────── */
.gls-pl-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #888;
    line-height: 1;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.gls-pl-close:hover {
    color: #333;
    background: #f0f0f0;
}

/* ── Title & message ────────────────────────────────────────────────────── */
.gls-pl-popup-title {
    margin: 0 0 8px;
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    padding-right: 32px;
    /* avoid overlap with close btn */
}

.gls-pl-popup-message {
    margin: 0 0 24px;
    font-size: 1.2rem;
    color: #555;
    line-height: 1.5;
}

/* ── Site list ──────────────────────────────────────────────────────────── */
.gls-pl-sites {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* Scroll happens here, not on the card, so border-radius is preserved */
    max-height: min(300px, 40vh);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

.gls-pl-site-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    font-size: 0.95rem;
    color: #222;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
    text-decoration: none;
}

.gls-pl-site-btn:hover {
    border-color: #6366f1;
    background: #f5f3ff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
    color: #222;
    text-decoration: none;
}

/* Suggested / detected site gets a highlighted style */
.gls-pl-site-btn.gls-pl-suggested {
    border-color: #6366f1;
    background: #eef2ff;
}

.gls-pl-site-btn.gls-pl-suggested:hover {
    background: #e0e7ff;
}

.gls-pl-site-flag {
    font-size: 1.6rem;
    line-height: 1;
    flex-shrink: 0;
}

.gls-pl-site-flag img {
    width: 2em !important;
    height: auto !important;
}

.gls-pl-site-info {
    flex: 1 1 auto;
}

.gls-pl-site-label {
    font-weight: 600;
    display: block;
}

.gls-pl-site-badge {
    display: inline-block;
    margin-top: 2px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #6366f1;
    background: #e0e7ff;
    border-radius: 999px;
    padding: 1px 8px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.gls-pl-site-current-badge {
    display: inline-block;
    margin-top: 2px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #059669;
    background: #d1fae5;
    border-radius: 999px;
    padding: 1px 8px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.gls-pl-site-arrow {
    flex-shrink: 0;
    color: #9ca3af;
    font-size: 1rem;
}

/* ── Dismiss link ───────────────────────────────────────────────────────── */
.gls-pl-footer {
    margin-top: 18px;
    text-align: center;
}

.gls-pl-dismiss {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.82rem;
    color: #9ca3af;
    text-decoration: underline;
    padding: 0;
    transition: color 0.15s;
}

.gls-pl-dismiss:hover {
    color: #555;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .gls-pl-popup {
        padding: 24px 16px 20px;
        border-radius: 10px;
    }

    .gls-pl-popup-title {
        font-size: 1.1rem;
    }
}

/* ── [geo_switcher] button shortcode ─────────────────────────────────────── */
.gls-pl-switcher-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    background: transparent;
    color: inherit;
    border: none;
    border-radius: 4px;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
    text-decoration: none;
    width: fit-content;

}

.gls-pl-switcher-flag img {
    width: 2.5em !important;
    height: auto !important;
}

.gls-pl-switcher-btn:hover {
    opacity: 0.75;
    transform: scale(1.1);
}

.gls-pl-switcher-btn:active {
    opacity: 0.55;
    transform: scale(1.0);
}

/* ── [geo_switcher style="inline"] list shortcode ────────────────────────── */
.gls-pl-inline-switcher {
    max-width: 560px;
    /* sensible default; override with a custom class */
}

/* On larger screens, you can optionally display the inline list as a grid */
@media (min-width: 600px) {
    .gls-pl-inline-switcher.gls-pl-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* Single-column list items become direct grid cells */
    .gls-pl-inline-switcher.gls-pl-grid li {
        margin: 0;
    }
}

/* ── Admin Preview notice ────────────────────────────────────────────────── */
.gls-pl-admin-preview-notice {
    margin: 0 0 16px;
    padding: 8px 12px;
    background: #eff6ff;
    border: 1px solid #93c5fd;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #1d4ed8;
    line-height: 1.4;
}