/* ═══════════════════════════════════════════════════════════
   PV Currency Switcher – Frontend Styles
   ═══════════════════════════════════════════════════════════ */

/* ── Switcher Container ─────────────────────────────────── */
.pvcs-custom-switcher {
    position: relative;
    display: inline-block;
    min-width: 100px;
    font-family: inherit;
    user-select: none;
    z-index: 999;
}

/* ── Trigger Button ─────────────────────────────────────── */
.pvcs-current-trigger {
    background: rgba(26, 26, 31, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 12px 20px;
    border-radius: 100px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.pvcs-current-trigger:hover,
.pvcs-current-trigger:focus-visible {
    border-color: rgba(33, 150, 243, 0.5);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.15);
}


/* ── Flag Icons ─────────────────────────────────────────── */
.pvcs-current-trigger .fi,
.pvcs-option .fi {
    font-size: 18px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* ── Options Panel (positioned wrapper) ─────────────────── */
.pvcs-options-wrap {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 100%;
    background: rgba(26, 26, 31, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    display: none;
    flex-direction: column;
    z-index: 1000;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 255, 255, 0.03);
}

.pvcs-custom-switcher.is-open .pvcs-options-wrap {
    display: flex;
    animation: pvcsSlideDown 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes pvcsSlideDown {
    from { transform: translateY(-8px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* ── Scrollable List (middle of flex column) ───────────── */
.pvcs-options-list {
    max-height: 280px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Scrollbar styling */
.pvcs-options-list::-webkit-scrollbar {
    width: 4px;
}
.pvcs-options-list::-webkit-scrollbar-track {
    background: transparent;
}
.pvcs-options-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

/* ── Scroll Indicator Arrows ───────────────────────────── */
/* Non-overlapping bars above/below the list */
.pvcs-scroll-arrow {
    display: none;
    align-items: center;
    justify-content: center;
    height: 28px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 10px;
    letter-spacing: 2px;
    flex-shrink: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    cursor: default;
}

.pvcs-scroll-arrow-up {
    border-top: none;
    border-radius: 16px 16px 0 0;
}

.pvcs-scroll-arrow-down {
    border-bottom: none;
    border-radius: 0 0 16px 16px;
}

/* Show when scrollable */
.pvcs-options-wrap.can-scroll-up .pvcs-scroll-arrow-up,
.pvcs-options-wrap.can-scroll-down .pvcs-scroll-arrow-down {
    display: flex;
}

/* ── Individual Options ─────────────────────────────────── */
.pvcs-option {
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.pvcs-option:last-child {
    border-bottom: none;
}

.pvcs-option:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.pvcs-option.is-active {
    background: rgba(33, 150, 243, 0.12);
    color: #2196f3;
    font-weight: 600;
}

.pvcs-option.is-active::after {
    content: '✓';
    margin-left: auto;
    font-size: 12px;
    opacity: 0.8;
}

.pvcs-code {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.pvcs-symbol {
    opacity: 0.45;
    font-size: 12px;
    margin-left: auto;
}

.pvcs-option.is-active .pvcs-symbol {
    margin-left: 0;
}

/* ── Display Modes ──────────────────────────────────────── */
.pvcs-display-flags .pvcs-code-label,
.pvcs-display-flags .pvcs-code,
.pvcs-display-flags .pvcs-symbol {
    display: none;
}

.pvcs-display-code .fi {
    display: none;
}

/* Compact: flag + code, hide symbol */
.pvcs-display-compact .pvcs-symbol {
    display: none;
}

/* ── Floating Wrapper ───────────────────────────────────── */
.pvcs-floating-wrap {
    position: fixed;
    bottom: 24px;
    z-index: 99999;
    animation: pvcsFloatIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.5s both;
}

/* Position: Bottom Left (default) */
.pvcs-floating-wrap.pvcs-float-left {
    left: 24px;
    right: auto;
}

/* Position: Bottom Right */
.pvcs-floating-wrap.pvcs-float-right {
    right: 24px;
    left: auto;
}

/* Dropdown alignment for right-positioned */
.pvcs-float-right .pvcs-options-wrap {
    left: auto;
    right: 0;
}

@keyframes pvcsFloatIn {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* Open upward when floating (bottom-anchored) */
.pvcs-floating-wrap .pvcs-options-wrap {
    top: auto;
    bottom: calc(100% + 8px);
}

@media (max-width: 480px) {
    .pvcs-floating-wrap {
        bottom: 16px;
    }

    .pvcs-float-left {
        left: 16px;
    }

    .pvcs-float-right {
        right: 16px;
    }

    .pvcs-current-trigger {
        padding: 10px 16px;
        font-size: 13px;
    }

    .pvcs-options-list {
        min-width: 180px;
    }
}
