/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3B82F6;
    --primary-hover: #2563EB;
    --secondary-color: #6B7280;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --error-color: #EF4444;
    --background: #F8FAFC;
    --surface: #FFFFFF;
    --surface-hover: #F1F5F9;
    --border: #E2E8F0;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-light: #94A3B8;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 12px;
    --border-radius-sm: 8px;
}

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

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

/* Header Styles */
.header {
    background: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
    overflow: hidden;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo i {
    font-size: 32px;
    color: var(--primary-color);
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), #8B5CF6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.wallet-status {
    display: flex;
    align-items: center;
    gap: 16px;
}

.connect-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.connect-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.wallet-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
    background: var(--surface-hover);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border);
}

.network-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

.network-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-color);
}

.address-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.copy-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s;
}

.copy-btn:hover {
    color: var(--primary-color);
}

.disconnect-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s;
}

.disconnect-btn:hover {
    color: var(--error-color);
}

/* Main Content Styles */
.main-content {
    display: grid;
    gap: 30px;
}

section {
    background: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

section h2 {
    background: linear-gradient(135deg, var(--primary-color), #8B5CF6);
    color: white;
    padding: 20px 24px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
}

/* Network Section */
.network-section .network-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 24px;
}

.network-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px;
    border: 2px solid var(--border);
    border-radius: var(--border-radius-sm);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.2s;
}

.network-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.network-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.network-btn img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.network-btn span {
    font-weight: 600;
}

/* AA Section */
.aa-info-card {
    padding: 24px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

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

.info-row label {
    font-weight: 600;
    color: var(--text-secondary);
}

.info-row span {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    /* max-width: 350px; */
    /* overflow: hidden; */
    /* text-overflow: ellipsis; */
}

.status-pending {
    color: var(--warning-color);
}

.status-deployed {
    color: var(--success-color);
    font-weight: 600;
}

.status-not-deployed {
    color: var(--error-color);
    font-weight: 600;
}

.action-buttons {
    display: flex;
    gap: 12px;
    padding: 0 24px 24px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn.primary {
    background: var(--primary-color);
    color: white;
}

.action-btn.primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.action-btn.secondary {
    background: var(--surface-hover);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.action-btn.secondary:hover {
    background: var(--border);
}

.action-btn.large {
    padding: 16px 32px;
    font-size: 16px;
    width: 100%;
    justify-content: center;
}

/* Token Section */
.token-input-group {
    display: flex;
    gap: 12px;
    padding: 24px;
    align-items: end;
}

.input-wrapper {
    flex: 1;
}

.input-wrapper label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
}

.token-input, .form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    transition: border-color 0.2s;
}

.token-input:focus, .form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.preset-btn {
    background: var(--warning-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    margin-left: 8px;
}

.token-presets {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px 24px;
    flex-wrap: wrap;
}

.preset-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 14px;
}

.preset-token {
    background: var(--surface-hover);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-token:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.token-info-card {
    margin: 0 24px 24px;
    padding: 20px;
    background: var(--surface-hover);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border);
}

.token-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.token-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.balance-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.balance-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--success-color);
    font-family: 'Monaco', 'Consolas', monospace;
}

/* Transfer Section */
.transfer-form {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
}

.amount-input-group {
    display: flex;
    gap: 8px;
}

.max-btn {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.amount-info {
    margin-top: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.token-summary {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 16px;
    background: var(--surface-hover);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border);
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 14px;
}

.no-balance-message {
    padding: 40px 24px;
    text-align: center;
    color: var(--text-secondary);
}

.no-balance-message i {
    font-size: 48px;
    margin-bottom: 16px;
    color: var(--text-light);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: var(--surface-hover);
    border-bottom: 1px solid var(--border);
}

.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
}

.modal-body {
    padding: 24px;
}

.tx-status {
    text-align: center;
}

.tx-message {
    margin: 20px 0;
    font-size: 16px;
    color: var(--text-secondary);
}

.tx-hash {
    margin-top: 20px;
    padding: 16px;
    background: var(--surface-hover);
    border-radius: var(--border-radius-sm);
}

.tx-hash label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.tx-hash a {
    color: var(--primary-color);
    text-decoration: none;
    font-family: 'Monaco', 'Consolas', monospace;
    word-break: break-all;
}

/* Loading Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-text {
    margin-top: 16px;
    font-size: 18px;
    font-weight: 600;
}

.spinner, .spinner-large {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 3px solid white;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.spinner {
    width: 30px;
    height: 30px;
}

.spinner-large {
    width: 50px;
    height: 50px;
}

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

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: var(--surface);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 16px 20px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--error-color);
}

.toast.warning {
    border-left: 4px solid var(--warning-color);
}

.toast.info {
    border-left: 4px solid var(--primary-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 16px;
}

.mb-4 {
    margin-bottom: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .network-buttons {
        grid-template-columns: 1fr;
    }
    
    .token-input-group {
        flex-direction: column;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .amount-input-group {
        flex-direction: column;
    }
    
    .wallet-info {
        width: 100%;
    }
    
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .info-row span {
        max-width: 100%;
        word-break: break-all;
    }
}
