/* =========================================
   货币切换器样式
   Currency Switcher Styles
   ========================================= */

/* 货币切换器容器 */
.currency-switcher {
    position: relative;
    margin-left: 20px;
}

/* 货币切换按钮 */
.currency-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.currency-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.currency-flag {
    font-size: 18px;
}

.currency-code {
    font-size: 13px;
    letter-spacing: 0.5px;
}

.currency-toggle i {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.currency-toggle:hover i {
    transform: translateY(2px);
}

/* 货币下拉菜单 */
.currency-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-width: 320px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

.currency-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 下拉菜单头部 */
.currency-dropdown-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.currency-dropdown-header h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: 600;
    color: white;
}

.currency-dropdown-header small {
    font-size: 11px;
    opacity: 0.9;
}

/* 货币列表 */
.currency-list {
    max-height: 350px;
    overflow-y: auto;
    padding: 8px;
}

.currency-list::-webkit-scrollbar {
    width: 6px;
}

.currency-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.currency-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

/* 货币选项 */
.currency-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border: 2px solid transparent;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 5px;
    width: 100%;
    text-align: left;
}

.currency-option:hover {
    background: #f8f9ff;
    border-color: #667eea;
    transform: translateX(5px);
}

.currency-option.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-color: #667eea;
}

.currency-option.active::after {
    content: '✓';
    margin-left: auto;
    color: #667eea;
    font-weight: bold;
    font-size: 16px;
}

.currency-option .currency-flag {
    font-size: 24px;
    flex-shrink: 0;
}

.currency-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.currency-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.currency-code-small {
    font-size: 12px;
    color: #666;
}

.currency-rate {
    font-size: 11px;
    color: #999;
    margin-left: auto;
    flex-shrink: 0;
}

/* 移动端响应式 */
@media (max-width: 768px) {
    .currency-switcher {
        margin-left: 10px;
    }
    
    .currency-toggle {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .currency-flag {
        font-size: 16px;
    }
    
    .currency-dropdown {
        right: auto;
        left: 50%;
        transform: translateX(-50%) translateY(-10px);
        min-width: 280px;
        max-width: 90vw;
    }
    
    .currency-dropdown.show {
        transform: translateX(-50%) translateY(0);
    }
    
    .currency-dropdown-header h4 {
        font-size: 13px;
    }
    
    .currency-option {
        padding: 10px 12px;
    }
    
    .currency-name {
        font-size: 13px;
    }
}

/* 价格显示动画 */
.price-value {
    transition: all 0.3s ease;
}

.price-value.updating {
    opacity: 0.5;
    transform: scale(0.98);
}

/* 加载状态 */
.currency-switcher.loading .currency-toggle {
    pointer-events: none;
    opacity: 0.7;
}

.currency-switcher.loading .currency-toggle::after {
    content: '';
    position: absolute;
    right: 10px;
    width: 12px;
    height: 12px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 汇率更新提示 */
.rate-update-notice {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #4caf50;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 10000;
}

.rate-update-notice.show {
    opacity: 1;
    transform: translateY(0);
}

.rate-update-notice i {
    margin-right: 8px;
}

/* 导航栏中的货币切换器 */
.nav-links .currency-switcher {
    display: inline-flex;
    align-items: center;
}

/* 确保与其他导航元素对齐 */
.nav-links > * {
    display: inline-flex;
    align-items: center;
}

/* 移动端菜单中的货币切换器 */
@media (max-width: 768px) {
    .nav-links.active .currency-switcher {
        margin: 10px 0;
        width: 100%;
    }
    
    .nav-links.active .currency-toggle {
        width: 100%;
        justify-content: center;
    }
}

/* 打印时隐藏货币切换器 */
@media print {
    .currency-switcher {
        display: none !important;
    }
}

/* 暗色主题支持（可选） */
@media (prefers-color-scheme: dark) {
    .currency-dropdown {
        background: #2d3748;
    }
    
    .currency-option {
        background: #2d3748;
        color: white;
    }
    
    .currency-option:hover {
        background: #4a5568;
    }
    
    .currency-name {
        color: white;
    }
    
    .currency-code-small {
        color: #cbd5e0;
    }
}

