/**
 * HBN Token Swap Widget Styles
 * Modern, clean design matching Socialite theme
 */

.hbn-swap-container {
    max-width: 420px;
    margin: 0 auto;
    padding: 20px;
}

.hbn-swap-widget {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.hbn-swap-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.hbn-swap-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.hbn-swap-settings-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #666;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.hbn-swap-settings-btn:hover {
    background: #f5f5f5;
    color: #1a1a1a;
}

.hbn-swap-body {
    padding: 20px;
}

.hbn-swap-input-group {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 8px;
    transition: border-color 0.2s;
    border: 2px solid transparent;
}

.hbn-swap-input-group:focus-within {
    border-color: var(--hbn-primary, #7B3FF2);
    background: #fff;
}

.hbn-swap-input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.hbn-swap-label {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.hbn-swap-balance {
    font-size: 12px;
    color: #888;
}

.hbn-swap-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hbn-swap-amount {
    flex: 1;
    background: none;
    border: none;
    font-size: 28px;
    font-weight: 500;
    color: #1a1a1a;
    outline: none;
    min-width: 0;
}

.hbn-swap-amount::placeholder {
    color: #ccc;
}

.hbn-swap-amount:read-only {
    color: #666;
}

.hbn-swap-token-select {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.hbn-swap-token-select:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.hbn-swap-token-select svg {
    flex-shrink: 0;
}

.hbn-swap-chain-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.hbn-chain-label {
    font-size: 12px;
    color: #888;
}

.hbn-swap-chain-select {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: var(--hbn-primary, #7B3FF2);
    transition: opacity 0.2s;
}

.hbn-swap-chain-select:hover {
    opacity: 0.8;
}

.hbn-swap-direction {
    display: flex;
    justify-content: center;
    margin: -4px 0;
    position: relative;
    z-index: 2;
}

.hbn-swap-direction-btn {
    width: 40px;
    height: 40px;
    background: #fff;
    border: 3px solid #f8f9fa;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: transform 0.2s, color 0.2s, background 0.2s;
}

.hbn-swap-direction-btn:hover {
    transform: rotate(180deg);
    color: var(--hbn-primary, #7B3FF2);
    background: #f5f0ff;
}

.hbn-swap-quote-info {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 12px 16px;
    margin-top: 16px;
}

.hbn-quote-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
}

.hbn-quote-row span:first-child {
    color: #666;
}

.hbn-quote-row span:last-child {
    color: #1a1a1a;
    font-weight: 500;
}

.hbn-swap-action-btn {
    width: 100%;
    padding: 16px;
    margin-top: 16px;
    background: linear-gradient(135deg, #7B3FF2 0%, #6B2FA7 100%);
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.hbn-swap-action-btn:hover:not(:disabled) {
    opacity: 0.9;
}

.hbn-swap-action-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.hbn-swap-action-btn:disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}

.hbn-swap-action-btn.hbn-btn-connect {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.hbn-swap-action-btn.hbn-btn-swap {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.hbn-btn-loader {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hbn-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: hbn-spin 0.8s linear infinite;
}

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

.hbn-swap-status {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

.hbn-swap-status.status-pending {
    background: #fef3cd;
    color: #856404;
}

.hbn-swap-status.status-success {
    background: #d4edda;
    color: #155724;
}

.hbn-swap-status.status-error {
    background: #f8d7da;
    color: #721c24;
}

.hbn-swap-footer {
    padding: 12px 20px;
    text-align: center;
    font-size: 11px;
    color: #999;
    border-top: 1px solid #f0f0f0;
}

/* Token Modal */
.hbn-token-modal,
.hbn-chain-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.hbn-token-modal-overlay,
.hbn-chain-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.hbn-token-modal-content,
.hbn-chain-modal-content {
    position: relative;
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: hbn-modal-slide-up 0.2s ease-out;
}

@keyframes hbn-modal-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hbn-token-modal-header,
.hbn-chain-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.hbn-token-modal-header h4,
.hbn-chain-modal-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.hbn-token-modal-close,
.hbn-chain-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.hbn-token-modal-close:hover,
.hbn-chain-modal-close:hover {
    color: #1a1a1a;
}

.hbn-token-search {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.hbn-token-search input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.hbn-token-search input:focus {
    border-color: var(--hbn-primary, #7B3FF2);
}

.hbn-token-list,
.hbn-chain-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.hbn-token-item,
.hbn-chain-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.hbn-token-item:hover,
.hbn-chain-item:hover {
    background: #f5f5f5;
}

.hbn-token-icon,
.hbn-chain-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

.hbn-token-info,
.hbn-chain-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hbn-token-name,
.hbn-chain-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

.hbn-token-fullname {
    font-size: 12px;
    color: #888;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .hbn-swap-container {
        padding: 12px;
    }
    
    .hbn-swap-widget {
        border-radius: 12px;
    }
    
    .hbn-swap-amount {
        font-size: 24px;
    }
    
    .hbn-token-modal-content,
    .hbn-chain-modal-content {
        max-height: 90vh;
        border-radius: 16px 16px 0 0;
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: none;
    }
    
    .hbn-token-modal,
    .hbn-chain-modal {
        align-items: flex-end;
        padding: 0;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .hbn-swap-widget {
        background: #1a1a1a;
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    }
    
    .hbn-swap-header {
        border-color: #333;
    }
    
    .hbn-swap-header h3 {
        color: #fff;
    }
    
    .hbn-swap-settings-btn {
        color: #888;
    }
    
    .hbn-swap-settings-btn:hover {
        background: #333;
        color: #fff;
    }
    
    .hbn-swap-input-group {
        background: #252525;
    }
    
    .hbn-swap-input-group:focus-within {
        background: #1a1a1a;
    }
    
    .hbn-swap-amount {
        color: #fff;
    }
    
    .hbn-swap-amount::placeholder {
        color: #666;
    }
    
    .hbn-swap-token-select {
        background: #333;
        border-color: #444;
        color: #fff;
    }
    
    .hbn-swap-token-select:hover {
        background: #404040;
        border-color: #555;
    }
    
    .hbn-swap-direction-btn {
        background: #1a1a1a;
        border-color: #252525;
    }
    
    .hbn-swap-direction-btn:hover {
        background: #0d3a6e;
    }
    
    .hbn-swap-quote-info {
        background: #252525;
    }
    
    .hbn-quote-row span:last-child {
        color: #fff;
    }
    
    .hbn-swap-footer {
        border-color: #333;
    }
    
    .hbn-token-modal-content,
    .hbn-chain-modal-content {
        background: #1a1a1a;
    }
    
    .hbn-token-modal-header,
    .hbn-chain-modal-header {
        border-color: #333;
    }
    
    .hbn-token-modal-header h4,
    .hbn-chain-modal-header h4 {
        color: #fff;
    }
    
    .hbn-token-search input {
        background: #252525;
        border-color: #444;
        color: #fff;
    }
    
    .hbn-token-item:hover,
    .hbn-chain-item:hover {
        background: #333;
    }
    
    .hbn-token-name,
    .hbn-chain-name {
        color: #fff;
    }
}
