/**
 * Currency Selector Styles
 * Beautiful, professional currency dropdown with smooth animations
 */

.currency-selector {
    position: relative;
    display: inline-block;
    z-index: 100;
}

.currency-selected {
    display: flex !important;
    align-items: center !important;
    gap: 0.375rem !important;
    padding: 0.4rem 0.75rem !important;
    background: white !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    color: #475569 !important;
    user-select: none !important;
    white-space: nowrap !important;
    min-width: 85px !important;
}

.currency-selected:hover {
    border-color: #94a3b8 !important;
    background: #f8fafc !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

.currency-flag {
    font-size: 1.125rem !important;
    line-height: 1 !important;
}

.currency-code {
    font-weight: 600 !important;
    color: #1e293b !important;
    font-size: 0.8125rem !important;
}

.currency-arrow {
    margin-left: 0.125rem !important;
    font-size: 0.625rem !important;
    transition: transform 0.3s ease !important;
    color: #64748b !important;
}

.currency-selector.active .currency-arrow {
    transform: rotate(180deg) !important;
}

/* Dropdown */
.currency-dropdown {
    position: absolute !important;
    top: calc(100% + 0.5rem) !important;
    right: 0 !important;
    background: white !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
    min-width: 200px !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 1000 !important;
    overflow: hidden !important;
    border: 1px solid #e2e8f0 !important;
}

.currency-dropdown.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

.currency-dropdown-header {
    padding: 0.75rem 1rem !important;
    border-bottom: 1px solid #e2e8f0 !important;
    font-size: 0.6875rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: #64748b !important;
    background: #f8fafc !important;
}

.currency-item {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0.75rem 1rem !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    color: #475569 !important;
    text-decoration: none !important;
    border: none !important;
    background: white !important;
}

.currency-item:hover {
    background: linear-gradient(90deg, #f8fafc 0%, #f1f5f9 100%) !important;
    padding-left: 1.125rem !important;
    text-decoration: none !important;
}

.currency-item.active {
    background: linear-gradient(90deg, #dbeafe 0%, #bfdbfe 100%) !important;
    color: #1e40af !important;
    font-weight: 600 !important;
}

.currency-item.active::after {
    content: '✓' !important;
    margin-left: auto !important;
    color: #1e40af !important;
    font-weight: bold !important;
}

.currency-item-flag {
    font-size: 1.375rem !important;
    line-height: 1 !important;
}

.currency-item-info {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.125rem !important;
    flex: 1 !important;
}

.currency-item-code {
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    color: inherit !important;
}

.currency-item-name {
    font-size: 0.6875rem !important;
    color: #64748b !important;
}

/* Price transition animations */
.convertible-price,
[data-price-rwf] {
    transition: opacity 0.15s ease-in-out;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .currency-selected {
        padding: 0.4rem 0.75rem;
        font-size: 0.8125rem;
    }

    .currency-dropdown {
        min-width: 200px;
        right: -1rem;
    }

    .currency-item {
        padding: 0.75rem 1rem;
    }

    .currency-flag {
        font-size: 1.125rem;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .currency-selected {
        background: #1e293b;
        border-color: #334155;
        color: #cbd5e1;
    }

    .currency-selected:hover {
        background: #334155;
        border-color: #475569;
    }

    .currency-code {
        color: #e2e8f0;
    }

    .currency-dropdown {
        background: #1e293b;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    }

    .currency-dropdown-header {
        border-color: #334155;
        color: #94a3b8;
    }

    .currency-item {
        color: #cbd5e1;
    }

    .currency-item:hover {
        background: linear-gradient(90deg, #334155 0%, #475569 100%);
    }

    .currency-item.active {
        background: linear-gradient(90deg, #1e40af 0%, #1d4ed8 100%);
        color: #dbeafe;
    }

    .currency-item-name {
        color: #94a3b8;
    }
}

/* Loading state */
.currency-loading {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}