/**
 * XDEX Wallet Component Styles
 * Styling for wallet connection interface
 */

/* Legacy styles */
.wallet-connected {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 255, 166, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 500;
}

.wallet-address {
    font-family: 'Roboto Mono', monospace;
    font-size: 13px;
}

.wallet-disconnect {
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.wallet-disconnect:hover {
    opacity: 1;
}

/* New Wallet Connect Component Styles */
.wallet-connect-component {
    margin-bottom: 1rem;
}

.wallet-status {
    background: var(--surface-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 1rem;
}

.wallet-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.wallet-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.wallet-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.wallet-details span:first-child {
    font-weight: 600;
    color: var(--text-primary);
}

.wallet-address {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-family: monospace;
}

.btn-wallet-menu {
    background: none;
    border: none;
    color: var(--text-tertiary);
    padding: 0.25rem;
    border-radius: 4px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.btn-wallet-menu:hover {
    color: var(--text-primary);
    background: var(--surface-tertiary);
}

.wallet-balance {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-secondary);
}

.balance-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

#wallet-balance {
    font-weight: 600;
    color: var(--text-primary);
    font-family: monospace;
}

/* Connect Button */
.btn-connect-wallet {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: var(--primary-gradient);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-connect-wallet:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 255, 166, 0.3);
}

.btn-connect-wallet:active {
    transform: translateY(0);
}

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

/* Wallet Modal */
.wallet-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.wallet-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.wallet-option:hover {
    border-color: var(--primary);
    background: var(--surface-tertiary);
    transform: translateY(-1px);
}

.wallet-option.not-installed {
    opacity: 0.6;
}

.wallet-option.not-installed:hover {
    opacity: 0.8;
}

.wallet-option img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    flex-shrink: 0;
}

.wallet-option-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.wallet-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.wallet-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.3;
}

.not-installed-badge {
    background: var(--semantic-warning);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 0.25rem;
    align-self: flex-start;
}

.wallet-detected {
    color: var(--semantic-success);
    font-size: 0.875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.wallet-detected::before {
    content: "●";
    color: var(--semantic-success);
}

.wallet-install {
    color: var(--text-tertiary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.wallet-install::after {
    content: "↗";
    color: var(--text-tertiary);
}

.wallet-info-text {
    padding: 1rem;
    background: var(--surface-tertiary);
    border-radius: 8px;
    margin-top: 1rem;
}

.wallet-info-text p {
    margin: 0;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wallet-option {
        padding: 0.875rem;
    }

    .wallet-option img {
        width: 36px;
        height: 36px;
    }

    .wallet-name {
        font-size: 0.9375rem;
    }

    .wallet-description {
        font-size: 0.8125rem;
    }
}

.wallet-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wallet-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-secondary);
}

.wallet-option:hover {
    border-color: var(--primary-color);
    background: rgba(0, 255, 166, 0.05);
    transform: translateY(-2px);
}

.wallet-option img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.wallet-option span {
    font-weight: 500;
    color: var(--text-primary);
}

/* Toast Styles */
.toast-container {
    z-index: 1080;
}

.toast {
    margin-bottom: 8px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Swap Interface Enhancements */
.swap-bx {
    position: relative;
}

.swap-in input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 255, 166, 0.1);
}

.exchange-ic a {
    transition: transform 0.2s;
}

.exchange-ic a:hover {
    transform: rotate(180deg);
}

.btn-action.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.xdex-btn {
    background: rgba(0, 255, 166, 0.1);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.xdex-btn:hover {
    background: var(--primary-color);
    color: var(--dark);
}

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Quote Display */
.quote-expired {
    color: var(--warning-color);
    font-style: italic;
}

.quote-valid {
    color: var(--success-color);
}

/* Price Impact Warnings */
.price-impact-low {
    color: var(--success-color);
}

.price-impact-medium {
    color: var(--warning-color);
}

.price-impact-high {
    color: var(--danger-color);
}

/* Responsive Improvements */
@media (max-width: 768px) {
    .wallet-connected {
        padding: 6px 10px;
        font-size: 13px;
    }

    .wallet-address {
        font-size: 12px;
    }

    .wallet-option {
        padding: 12px;
    }
}

/* Dark Theme Support */
body.dark-theme .wallet-option {
    background: var(--dark-secondary);
    border-color: var(--dark-border);
}

body.dark-theme .wallet-option:hover {
    background: rgba(0, 255, 166, 0.1);
    border-color: var(--primary-color);
}

body.dark-theme .wallet-connected {
    background: rgba(0, 255, 166, 0.15);
}

/* Animation for wallet connection */
.wallet-connecting {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Token selector improvements */
.drop-div {
    cursor: pointer;
    transition: all 0.2s;
}

.drop-div:hover {
    background: rgba(0, 255, 166, 0.05);
    border-color: var(--primary-color);
}

.left-img img {
    transition: transform 0.2s;
}

.drop-div:hover .left-img img {
    transform: scale(1.1);
}
