/**
 * Currency Exchange Frontend Styles - Performance Optimized
 */

/* Currency Switcher Container */
.currency-exchange-switcher {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    background-color: #fff;
    transition: transform 0.3s ease;
    will-change: transform;
    transition: all ease-in-out 0.3s;
}

/* Current Currency Display */
.currency-exchange-current {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.currency-exchange-current:hover {
    background-color: #f5f5f5;
}

/* Currency Flag */
.currency-flag {
    width: 24px;
    height: 16px;
    margin-right: 8px;
    border: 1px solid #eee;
}

/* Currency Code */
.currency-code {
    font-weight: 500;
    margin-right: 8px;
}

/* Toggle Arrow */
.currency-toggle {
    display: flex;
    align-items: center;
}

/* Currency Dropdown */
.currency-exchange-dropdown {
    position: absolute;
    bottom: 100%;
    right: 0;
    width: 240px;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 8px;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    transition: max-height 0.3s, opacity 0.3s;
}

/* Open Dropdown */
.currency-exchange-dropdown.open {
    max-height: 300px;
    opacity: 1;
    visibility: visible;
    overflow-y: auto;
}

/* Dropdown List */
.currency-exchange-dropdown ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Dropdown List Item */
.currency-exchange-dropdown li {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.currency-exchange-dropdown li:hover {
    background-color: #f9f9f9;
}

.currency-exchange-dropdown li.selected {
    background-color: #f0f7ff;
}

/* Currency Name */
.currency-name {
    flex-grow: 1;
    margin-right: 8px;
}

/* Currency Code in Dropdown */
.currency-exchange-dropdown .currency-code {
    color: #666;
    font-weight: normal;
    margin-right: 0;
}

/* Arrow pointing to current currency button */
.currency-exchange-dropdown::after {
    content: "";
    position: absolute;
    bottom: -8px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #fff;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .currency-exchange-switcher {
        bottom: 60px;
        right: 10px;
        transform: scale(0.9);
        transform-origin: bottom right;
    }
    
    .currency-exchange-dropdown {
        width: 200px;
    }
}

/* Optimize for reduced motion */
@media (prefers-reduced-motion: reduce) {
    .currency-exchange-switcher,
    .currency-exchange-current,
    .currency-exchange-dropdown {
        transition: none;
    }
}