/* LCM Currency Selector */

/* Top Currency Bar */
#lcm-currency-top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(23, 23, 23, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    z-index: 9997;
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateY(0);
    opacity: 1;
}

body.admin-bar #lcm-currency-top-bar {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar #lcm-currency-top-bar {
        top: 46px;
    }
}

#lcm-currency-top-bar.lcm-hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.lcm-currency-bar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.lcm-currency-bar-label {
    font-size: var(--text-s, 14px);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.lcm-currency-bar-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

.lcm-currency-bar-trigger:hover {
    border-color: #da017c;
    background: rgba(218, 1, 124, 0.1);
}

.lcm-currency-bar-trigger:focus-visible {
    outline: 2px solid #da017c;
    outline-offset: 2px;
}

.lcm-currency-bar-trigger img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.lcm-currency-bar-trigger span {
    font-size: var(--text-s, 14px);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

.lcm-currency-bar-trigger svg {
    color: rgba(255, 255, 255, 0.7);
    transition: transform 0.2s ease;
}

.lcm-currency-bar-trigger:hover svg {
    color: #da017c;
}

/* Floating Currency Button */
#lcm-currency-selector-wrapper {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

#lcm-currency-selector-wrapper.lcm-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#lcm-currency-trigger {
    height: 56px;
    min-width: 56px;
    padding: 0 16px 0 8px;
    border-radius: 28px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    position: relative;
}

#lcm-currency-trigger:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    border-color: #da017c;
}

#lcm-currency-trigger:active {
    transform: scale(0.98);
}

#lcm-currency-trigger:focus-visible {
    outline: 3px solid #da017c;
    outline-offset: 2px;
}

#lcm-current-flag {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    pointer-events: none;
    flex-shrink: 0;
}

.lcm-currency-label {
    font-size: var(--text-s, 14px);
    font-weight: 500;
    color: var(--secondary-dark, #1e1b4b);
    white-space: nowrap;
    pointer-events: none;
}

/* Dialog Backdrop */
#lcm-currency-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(103, 17, 110, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 9998;
}

#lcm-currency-backdrop.lcm-active {
    opacity: 1;
    visibility: visible;
}

/* Currency Dialog */
#lcm-currency-dialog {
    position: fixed;
    bottom: 96px;
    right: 24px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    padding: 0;
    min-width: 300px;
    max-width: 400px;
    max-height: 70vh;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
}

#lcm-currency-dialog.lcm-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#lcm-currency-dialog.lcm-confirming {
    pointer-events: none;
}

.lcm-currency-dialog-content {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.lcm-currency-dialog-close {
    position: sticky;
    top: 0;
    float: right;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.2s ease;
    z-index: 1;
    margin-bottom: -32px;
}

.lcm-currency-dialog-close:hover {
    background: #f3f4f6;
    color: var(--secondary-dark, #1e1b4b);
}

.lcm-currency-dialog-close:focus-visible {
    outline: 2px solid #da017c;
    outline-offset: 2px;
}

#lcm-currency-dialog h3 {
    margin: 0 0 16px 0;
    padding-top: 8px;
    font-size: var(--text-m, 16px);
    font-weight: 600;
    color: var(--secondary-dark, #1e1b4b);
}

/* Currency Options */
.lcm-currency-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lcm-currency-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    width: 100%;
    text-align: left;
    min-height: 60px;
}

.lcm-currency-option:hover {
    border-color: #da017c;
    background: #fef2f8;
}

.lcm-currency-option:focus-visible {
    outline: 2px solid #da017c;
    outline-offset: 2px;
}

.lcm-currency-option.lcm-selected {
    border-color: #da017c;
    background: #fef2f8;
}

.lcm-currency-option.lcm-just-selected {
    border-color: #da017c;
    background: #fce7f3;
    animation: lcm-pulse-selection 0.4s ease;
}

@keyframes lcm-pulse-selection {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

.lcm-currency-option img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.lcm-currency-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 2px;
    min-width: 0;
}

.lcm-currency-code {
    font-size: var(--text-s, 14px);
    font-weight: 600;
    color: var(--secondary-dark, #1e1b4b);
}

.lcm-currency-name {
    font-size: var(--text-xs, 12px);
    color: #6b7280;
}

.lcm-currency-symbol {
    font-size: var(--text-m, 16px);
    font-weight: 600;
    color: #da017c;
    flex-shrink: 0;
    margin-right: 8px;
}

.lcm-selected-indicator {
    flex-shrink: 0;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lcm-currency-option.lcm-selected .lcm-selected-indicator {
    opacity: 1;
    transform: scale(1);
}

.lcm-currency-option.lcm-just-selected .lcm-selected-indicator {
    animation: lcm-bounce-check 0.5s ease;
}

@keyframes lcm-bounce-check {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #lcm-currency-top-bar {
        display: block;
    }

    .lcm-currency-bar-content {
        flex-direction: column;
        gap: 8px;
        padding: 12px 16px;
    }

    .lcm-currency-bar-label {
        font-size: var(--text-xs, 12px);
    }

    .lcm-currency-bar-trigger {
        padding: 6px 12px;
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }

    .lcm-currency-bar-trigger span {
        font-size: var(--text-xs, 12px);
    }

    #lcm-currency-selector-wrapper {
        bottom: 16px;
        right: 16px;
    }

    #lcm-currency-dialog {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        border-radius: 16px 16px 0 0;
        max-height: 80vh;
        min-width: unset;
        max-width: unset;
    }

    .lcm-currency-dialog-content {
        max-height: calc(80vh - 40px);
    }

    #lcm-currency-trigger {
        height: 52px;
        min-width: 52px;
        padding: 0 14px 0 8px;
    }

    #lcm-current-flag {
        width: 28px;
        height: 28px;
    }

    .lcm-currency-label {
        font-size: var(--text-xs, 12px);
    }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    #lcm-currency-top-bar,
    #lcm-currency-selector-wrapper,
    #lcm-currency-trigger,
    #lcm-currency-dialog,
    #lcm-currency-backdrop,
    .lcm-currency-option,
    .lcm-selected-indicator {
        transition: none;
        animation: none;
    }
}
