/* Auto Currency Switcher Frontend - v1.4.1 Modern Smooth Design */

/* Base Floating Wrapper */
.acsw-float-wrapper {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Floating Trigger Button */
.acsw-float-btn {
    background: #111111;
    color: #ffffff;
    border: none;
    border-radius: 30px 0 0 30px;
    padding: 12px 16px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    box-shadow: -4px 4px 20px rgba(0, 0, 0, 0.22);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
    min-width: 64px;
    outline: none;
    will-change: transform;
}

.acsw-float-btn:hover {
    background: #000000;
    padding-right: 22px;
    box-shadow: -6px 8px 25px rgba(0, 0, 0, 0.32);
    transform: scale(1.05);
}

.acsw-float-btn:active {
    transform: scale(0.95);
}

.acsw-float-btn.acsw-open {
    background: #000000;
    box-shadow: -6px 8px 30px rgba(0, 0, 0, 0.4);
    transform: scale(1.05);
}

.acsw-btn-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.acsw-float-btn:hover .acsw-btn-flag {
    transform: scale(1.1);
}

.acsw-btn-flag img.acsw-flag-img {
    width: 24px;
    height: 16px;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.acsw-btn-code {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    opacity: 0.95;
    text-transform: uppercase;
}

/* Base Popup Container */
.acsw-popup {
    position: fixed;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    z-index: 1000000;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
}

.acsw-popup.acsw-open {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Desktop Positioning (screens wider than 768px) */
@media(min-width: 769px) {
    .acsw-popup {
        position: fixed !important;
        right: 80px !important;
        left: auto !important;
        top: 50% !important;
        bottom: auto !important;
        width: 330px !important;
        max-width: calc(100vw - 100px) !important;
        transform: translateY(-50%) translateX(25px) scale(0.95);
    }
    .acsw-popup.acsw-open {
        position: fixed !important;
        right: 80px !important;
        left: auto !important;
        top: 50% !important;
        bottom: auto !important;
        transform: translateY(-50%) translateX(0) scale(1) !important;
    }
}

/* Inner Popup Components */
.acsw-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: rgba(248, 249, 250, 0.8);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.acsw-popup-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.2px;
}

.acsw-close {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.acsw-close:hover {
    background: #f1f5f9;
    color: #0f172a;
    transform: rotate(90deg) scale(1.12);
    border-color: #cbd5e1;
}

.acsw-close:active {
    transform: rotate(90deg) scale(0.95);
}

.acsw-popup-body {
    padding: 14px;
    max-height: 380px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.acsw-auto-note {
    font-size: 12px;
    line-height: 1.4;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 10px 12px;
    border-radius: 10px;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.acsw-auto-note::before {
    content: "📍";
    font-size: 14px;
}

.acsw-currency-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.acsw-currency-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    border: 1px solid transparent;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.6);
}

.acsw-currency-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateX(-4px) scale(1.01);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.acsw-currency-item:active {
    transform: translateX(-2px) scale(0.98);
}

.acsw-currency-item.active {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
    box-shadow: 0 8px 20px -4px rgba(15, 23, 42, 0.35);
}

.acsw-currency-item.active:hover {
    background: #1e293b;
    border-color: #1e293b;
    transform: translateX(-4px) scale(1.01);
}

/* Stagger Entrance Animation */
.acsw-popup.acsw-open .acsw-currency-item {
    animation: acswItemFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.acsw-popup.acsw-open .acsw-currency-item:nth-child(1) { animation-delay: 0.04s; }
.acsw-popup.acsw-open .acsw-currency-item:nth-child(2) { animation-delay: 0.08s; }
.acsw-popup.acsw-open .acsw-currency-item:nth-child(3) { animation-delay: 0.12s; }
.acsw-popup.acsw-open .acsw-currency-item:nth-child(4) { animation-delay: 0.16s; }
.acsw-popup.acsw-open .acsw-currency-item:nth-child(5) { animation-delay: 0.20s; }
.acsw-popup.acsw-open .acsw-currency-item:nth-child(6) { animation-delay: 0.24s; }
.acsw-popup.acsw-open .acsw-currency-item:nth-child(7) { animation-delay: 0.28s; }
.acsw-popup.acsw-open .acsw-currency-item:nth-child(8) { animation-delay: 0.32s; }

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

.acsw-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 20px;
    flex-shrink: 0;
}

.acsw-flag-img {
    width: 24px;
    height: 16px;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    display: inline-block;
    vertical-align: middle;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.acsw-currency-item:hover .acsw-flag-img {
    transform: scale(1.12);
}

.acsw-code {
    font-weight: 700;
    font-size: 14px;
    min-width: 44px;
    letter-spacing: 0.3px;
}

.acsw-symbol {
    font-size: 13px;
    opacity: 0.85;
    min-width: 36px;
}

.acsw-name {
    flex: 1;
    font-size: 12px;
    opacity: 0.8;
}

.acsw-check {
    font-weight: bold;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    animation: acswPopCheck 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes acswPopCheck {
    0% {
        transform: scale(0) rotate(-45deg);
        opacity: 0;
    }
    70% {
        transform: scale(1.3) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.acsw-popup-footer {
    padding: 12px 16px;
    background: rgba(248, 249, 250, 0.8);
    text-align: center;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.acsw-popup-footer small {
    color: #64748b;
    font-size: 11px;
    font-weight: 500;
}

/* Glassmorphism Backdrop Overlay */
.acsw-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity;
}

.acsw-overlay.acsw-open {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

/* Inline Shortcode Switcher */
.acsw-inline-switcher .acsw-inline-select {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    font-weight: 500;
    transition: all 0.2s ease;
}

.acsw-inline-switcher .acsw-inline-select:focus {
    border-color: #0f172a;
    outline: none;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.1);
}

/* Mobile Responsive Layout (screens <= 768px) */
@media(max-width: 768px) {
    .acsw-float-wrapper {
        position: fixed !important;
        right: 0 !important;
        top: 50% !important;
        bottom: auto !important;
        left: auto !important;
        transform: translateY(-50%) !important;
        z-index: 999999;
    }

    .acsw-float-btn {
        border-radius: 24px 0 0 24px;
        flex-direction: column;
        gap: 2px;
        padding: 10px 12px;
        min-width: 52px;
    }

    .acsw-btn-flag img.acsw-flag-img {
        width: 22px;
        height: 14px;
    }

    .acsw-btn-code {
        font-size: 9px;
    }

    .acsw-popup {
        position: fixed !important;
        left: 50% !important;
        right: auto !important;
        top: 50% !important;
        bottom: auto !important;
        transform: translate(-50%, -45%) scale(0.92) !important;
        width: 88vw !important;
        max-width: 310px !important;
        border-radius: 16px;
        margin: 0 !important;
    }

    .acsw-popup.acsw-open {
        position: fixed !important;
        left: 50% !important;
        right: auto !important;
        top: 50% !important;
        bottom: auto !important;
        transform: translate(-50%, -50%) scale(1) !important;
    }

    .acsw-popup-header {
        padding: 12px 14px;
    }

    .acsw-popup-header h3 {
        font-size: 14px;
    }

    .acsw-close {
        width: 26px;
        height: 26px;
        font-size: 16px;
    }

    .acsw-popup-body {
        padding: 10px;
        max-height: 300px;
    }

    .acsw-auto-note {
        font-size: 11px;
        padding: 8px 10px;
        margin-bottom: 8px;
    }

    .acsw-currency-item {
        padding: 9px 11px;
        gap: 8px;
        margin-bottom: 4px;
        border-radius: 10px;
    }

    .acsw-flag {
        width: 22px;
        height: 16px;
    }

    .acsw-flag-img {
        width: 22px;
        height: 14px;
    }

    .acsw-code {
        font-size: 13px;
        min-width: 36px;
    }

    .acsw-symbol {
        font-size: 12px;
        min-width: 28px;
    }

    .acsw-name {
        font-size: 11px;
    }

    .acsw-popup-footer {
        padding: 8px 12px;
    }

    .acsw-popup-footer small {
        font-size: 10px;
    }
}