/* 
 * huncoin 组件库
 * 专用的UI组件样式，解决组件重复问题
 */

/* ==================== 钱包连接组件 ==================== */
.wallet-connect {
    position: relative;
    display: inline-block;
}

.wallet-btn {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-6);
    background: var(--gradient-cyber);
    color: white;
    border: 1px solid var(--cyber-blue);
    border-radius: var(--radius-lg);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    transition: var(--transition-fast);
    cursor: pointer;
}

.wallet-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.wallet-btn .icon {
    width: 20px;
    height: 20px;
}

.wallet-status {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--font-size-sm);
}

.wallet-status.connected {
    color: var(--success);
}

.wallet-status.disconnected {
    color: var(--text-muted);
}

.wallet-address {
    font-family: var(--font-family-mono);
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    background: var(--glass-bg);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-secondary);
}

.wallet-balance {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: var(--font-weight-medium);
}

.wallet-balance .amount {
    color: var(--text-accent);
}

.wallet-balance .currency {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

/* ==================== 统计卡片组件 ==================== */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    backdrop-filter: var(--glass-blur);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-cyber);
    opacity: 0;
    transition: var(--transition-fast);
}

.stat-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.stat-card-title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card-icon {
    width: 24px;
    height: 24px;
    color: var(--text-accent);
}

.stat-card-value {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.stat-card-change {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--font-size-sm);
}

.stat-card-change.positive {
    color: var(--success);
}

.stat-card-change.negative {
    color: var(--error);
}

.stat-card-change.neutral {
    color: var(--text-muted);
}

/* ==================== 混币器表单组件 ==================== */
.mixer-form {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    backdrop-filter: var(--glass-blur);
    max-width: 500px;
    margin: 0 auto;
}

.mixer-form-header {
    text-align: center;
    margin-bottom: var(--space-8);
}

.mixer-form-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.mixer-form-subtitle {
    color: var(--text-secondary);
    font-size: var(--font-size-base);
}

.mixer-form-group {
    margin-bottom: var(--space-6);
}

.mixer-form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
}

.mixer-input-group {
    position: relative;
}

.mixer-input {
    width: 100%;
    padding: var(--space-4) var(--space-6);
    font-size: var(--font-size-lg);
    color: var(--text-primary);
    background: var(--glass-bg);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    backdrop-filter: var(--glass-blur);
    transition: var(--transition-fast);
    outline: none;
}

.mixer-input:focus {
    border-color: var(--border-accent);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.mixer-input-suffix {
    position: absolute;
    right: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

.mixer-pool-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: var(--space-3);
    margin-top: var(--space-3);
}

.pool-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-4);
    background: var(--glass-bg);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition-fast);
}

.pool-option:hover {
    border-color: var(--border-accent);
    background: rgba(0, 212, 255, 0.05);
}

.pool-option.selected {
    border-color: var(--cyber-blue);
    background: rgba(0, 212, 255, 0.1);
    box-shadow: var(--shadow-glow);
}

.pool-amount {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
}

.pool-currency {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-transform: uppercase;
}

/* ==================== 进度指示器组件 ==================== */
.progress-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-8);
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
}

.progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 16px;
    left: calc(50% + 20px);
    right: calc(-50% + 20px);
    height: 2px;
    background: var(--border-secondary);
    z-index: 1;
}

.progress-step.completed:not(:last-child)::after,
.progress-step.active:not(:last-child)::after {
    background: var(--gradient-cyber);
}

.step-indicator {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--border-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    color: var(--text-muted);
    position: relative;
    z-index: 2;
    transition: var(--transition-fast);
}

.progress-step.active .step-indicator {
    background: var(--gradient-cyber);
    color: white;
    box-shadow: var(--shadow-glow);
}

.progress-step.completed .step-indicator {
    background: var(--success);
    color: white;
}

.step-label {
    margin-top: var(--space-2);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--text-muted);
    text-align: center;
}

.progress-step.active .step-label,
.progress-step.completed .step-label {
    color: var(--text-primary);
}

/* ==================== 通知组件 ==================== */
.notification {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.notification::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: var(--info);
}

.notification.success::before {
    background: var(--success);
}

.notification.warning::before {
    background: var(--warning);
}

.notification.error::before {
    background: var(--error);
}

.notification-icon {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    color: var(--info);
}

.notification.success .notification-icon {
    color: var(--success);
}

.notification.warning .notification-icon {
    color: var(--warning);
}

.notification.error .notification-icon {
    color: var(--error);
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.notification-message {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: var(--line-height-normal);
}

.notification-close {
    width: 20px;
    height: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.notification-close:hover {
    background: var(--glass-bg);
    color: var(--text-primary);
}

/* ==================== 加载状态组件 ==================== */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-secondary);
    border-top: 2px solid var(--text-accent);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
}

.loading-spinner.lg {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

.loading-dots {
    display: inline-flex;
    gap: var(--space-1);
}

.loading-dot {
    width: 6px;
    height: 6px;
    background: var(--text-accent);
    border-radius: var(--radius-full);
    animation: pulse 1.5s infinite;
}

.loading-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dot:nth-child(3) {
    animation-delay: 0.4s;
}

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

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: var(--glass-blur);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
}

/* ==================== 表格组件 ==================== */
.table {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    backdrop-filter: var(--glass-blur);
    overflow: hidden;
}

.table-header {
    background: var(--glass-bg);
    border-bottom: 1px solid var(--border-secondary);
}

.table-row {
    border-bottom: 1px solid var(--border-secondary);
    transition: var(--transition-fast);
}

.table-row:hover {
    background: var(--glass-bg);
}

.table-row:last-child {
    border-bottom: none;
}

.table-cell {
    padding: var(--space-4) var(--space-6);
    font-size: var(--font-size-sm);
    color: var(--text-primary);
}

.table-header .table-cell {
    font-weight: var(--font-weight-semibold);
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==================== 徽章组件 ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-400);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-neutral {
    background: var(--glass-bg);
    color: var(--text-muted);
    border: 1px solid var(--border-secondary);
}

/* ==================== 工具提示组件 ==================== */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-content {
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    padding: var(--space-2) var(--space-3);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: var(--font-size-xs);
    border-radius: var(--radius-md);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
    z-index: var(--z-tooltip);
    box-shadow: var(--shadow-lg);
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--bg-tertiary);
}

.tooltip:hover .tooltip-content {
    opacity: 1;
    visibility: visible;
}

/* ==================== 响应式组件调整 ==================== */
@media (max-width: 768px) {
    .mixer-form {
        padding: var(--space-6);
        margin: 0 var(--space-4);
    }
    
    .mixer-pool-selector {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .progress-stepper {
        flex-direction: column;
        gap: var(--space-4);
    }
    
    .progress-step:not(:last-child)::after {
        display: none;
    }
    
    .table {
        font-size: var(--font-size-xs);
    }
    
    .table-cell {
        padding: var(--space-3) var(--space-4);
    }
    
    .stat-card {
        padding: var(--space-4);
    }
    
    .stat-card-value {
        font-size: var(--font-size-2xl);
    }
}

@media (max-width: 480px) {
    .mixer-pool-selector {
        grid-template-columns: 1fr;
    }
    
    .notification {
        padding: var(--space-3);
    }
    
    .wallet-btn {
        width: 100%;
        justify-content: center;
    }
}