/* X402 Token Exchange - Modern CSS Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

.protocol-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.3);
}

/* Main Exchange Card */
.exchange-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    max-width: 500px;
    margin: 0 auto;
}

.exchange-title {
    text-align: center;
    margin-bottom: 30px;
}

.exchange-title h2 {
    font-size: 1.8rem;
    color: #2d3748;
    margin-bottom: 10px;
}

.exchange-subtitle {
    color: #718096;
    font-size: 1rem;
}

/* Payment Info */
.payment-info {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #e2e8f0;
}

.payment-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.payment-row:last-child {
    margin-bottom: 0;
}

.payment-label {
    font-weight: 600;
    color: #4a5568;
}

.payment-value {
    font-weight: 700;
    color: #2d3748;
}

.usdc-amount {
    color: #0052ff;
    font-size: 1.2rem;
}

.token-amount {
    color: #38a169;
    font-size: 1.2rem;
}

/* Wallet Connection */
.wallet-section {
    margin-bottom: 30px;
}

.wallet-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: #f7fafc;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid #e2e8f0;
}

.wallet-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e53e3e;
}

.status-indicator.connected {
    background: #38a169;
}

.wallet-address {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    color: #4a5568;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover:not(:disabled) {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.btn-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.4);
}

/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

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

/* Transaction Status */
.transaction-status {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-weight: 500;
}

.status-pending {
    background: #fef5e7;
    color: #d69e2e;
    border: 1px solid #f6e05e;
}

.status-success {
    background: #f0fff4;
    color: #38a169;
    border: 1px solid #9ae6b4;
}

.status-error {
    background: #fed7d7;
    color: #e53e3e;
    border: 1px solid #feb2b2;
}

/* Transaction Hash */
.tx-hash {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    word-break: break-all;
    margin-top: 10px;
    padding: 10px;
    background: rgba(0,0,0,0.05);
    border-radius: 6px;
}

.tx-link {
    color: #0052ff;
    text-decoration: none;
}

.tx-link:hover {
    text-decoration: underline;
}

/* Network Info */
.network-info {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    color: white;
}

.network-badge {
    display: inline-block;
    background: #0052ff;
    color: white;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .exchange-card {
        padding: 20px;
        margin: 10px;
    }
    
    .payment-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .wallet-status {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Animation for card entrance */
.exchange-card {
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulse animation for status indicator */
.status-indicator.connected {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(56, 161, 105, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(56, 161, 105, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(56, 161, 105, 0);
    }
}

/* Hover effects */
.exchange-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

/* Focus styles for accessibility */
.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.5);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}