/* OnrampDLT - Dark Theme with Gold Accents */

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #151515;
    --bg-tertiary: #1f1f1f;
    --bg-card: #1a1a1a;
    --border-color: #2a2a2a;
    
    --gold-primary: #d4af37;
    --gold-secondary: #f4d03f;
    --gold-dark: #b8941f;
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Testnet Banner */
.testnet-banner {
    background: linear-gradient(90deg, #f59e0b, #d97706);
    color: #000;
    text-align: center;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.testnet-banner.mainnet {
    background: linear-gradient(90deg, #10b981, #059669);
    color: #fff;
}

.network-toggle {
    margin-left: auto;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-switch {
    width: 36px;
    height: 20px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    position: relative;
    transition: background 0.2s;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: left 0.2s;
}

.toggle-label input:checked + .toggle-switch {
    background: rgba(0,0,0,0.4);
}

.toggle-label input:checked + .toggle-switch::after {
    left: 18px;
}

.testnet-indicator {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    margin-right: 8px;
    font-weight: 600;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 32px 0;
    border-bottom: 1px solid var(--border-color);
}

.logo h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.tagline {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Wallet Section */
.wallet-section {
    position: relative;
}

.wallet-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.wallet-address {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: var(--gold-primary);
}

.wallet-balance {
    font-size: 13px;
    color: var(--text-secondary);
    padding-left: 12px;
    border-left: 1px solid var(--border-color);
}

/* Navigation */
.nav {
    display: flex;
    gap: 8px;
    padding: 24px 0;
    border-bottom: 1px solid var(--border-color);
}

.nav-btn {
    padding: 10px 20px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-btn.active {
    background: var(--bg-tertiary);
    color: var(--gold-primary);
    border: 1px solid var(--gold-primary);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-secondary));
    color: #000;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--gold-secondary), var(--gold-primary));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--gold-primary);
}

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

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Main Content */
.main-content {
    padding: 40px 0;
    min-height: 60vh;
}

/* Views */
.view {
    display: none;
}

.view.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.view-header h2 {
    font-size: 28px;
    font-weight: 600;
}

/* Tokens Grid */
.tokens-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.token-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    cursor: pointer;
    transition: all 0.2s;
}

.token-card:hover {
    border-color: var(--gold-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.token-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.token-code {
    font-size: 24px;
    font-weight: 700;
    color: var(--gold-primary);
}

.token-status {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
}

.token-status.active {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.token-name {
    font-size: 16px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.token-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.token-stats {
    display: flex;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.token-stat {
    flex: 1;
}

.token-stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.token-stat-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* Wizard */
.wizard {
    max-width: 800px;
    margin: 0 auto;
}

.wizard-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 48px;
    position: relative;
}

.wizard-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--border-color);
    z-index: 0;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex: 1;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.wizard-step.active .step-number {
    background: var(--gold-primary);
    border-color: var(--gold-primary);
    color: #000;
}

.wizard-step.completed .step-number {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

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

.wizard-step.active .step-label {
    color: var(--gold-primary);
}

/* Wizard Panels */
.wizard-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
}

.wizard-panel {
    display: none;
}

.wizard-panel.active {
    display: block;
    animation: slideIn 0.3s ease;
}

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

.wizard-panel h3 {
    font-size: 22px;
    margin-bottom: 24px;
    color: var(--gold-primary);
}

/* Forms */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.form-group small {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 12px;
    border-radius: var(--radius-md);
    transition: background 0.2s;
}

.checkbox-label:hover {
    background: var(--bg-tertiary);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--gold-primary);
}

.checkbox-label span {
    font-weight: 500;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.form-actions .btn {
    flex: 1;
}

/* Review Section */
.review-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
}

.review-section h4 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--gold-primary);
}

.review-list,
.detail-list {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 16px;
}

.review-list dt,
.detail-list dt {
    font-weight: 500;
    color: var(--text-secondary);
}

.review-list dd,
.detail-list dd {
    color: var(--text-primary);
    word-break: break-word;
}

.warning-box {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning);
    border-radius: var(--radius-md);
    padding: 16px;
    color: var(--warning);
    margin-bottom: 24px;
}

/* History List */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.history-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.history-item:hover {
    border-color: var(--gold-primary);
}

.history-info h4 {
    font-size: 18px;
    margin-bottom: 6px;
}

.history-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary);
}

.history-actions {
    display: flex;
    gap: 8px;
}

/* Token Detail */
.token-detail-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.detail-card h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--gold-primary);
}

.address,
.hash {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    word-break: break-all;
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}

.explorer-links {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

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

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.modal-header h3 {
    font-size: 20px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

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

.modal-body {
    padding: 24px;
}

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

.wallet-option {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 16px;
}

.wallet-option:hover {
    border-color: var(--gold-primary);
    background: var(--bg-secondary);
}

.wallet-icon {
    font-size: 32px;
}

.wallet-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.wallet-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

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

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top-color: var(--gold-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-overlay p {
    margin-top: 20px;
    font-size: 16px;
    color: var(--text-secondary);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    box-shadow: var(--shadow-lg);
    z-index: 4000;
    display: none;
    min-width: 300px;
    animation: toastSlideIn 0.3s ease;
}

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

.toast.show {
    display: block;
}

.toast.success {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.toast.error {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.toast.warning {
    border-color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
}

/* Footer */
.footer {
    border-top: 1px solid var(--border-color);
    padding: 32px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

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

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .nav {
        overflow-x: auto;
        padding-bottom: 16px;
    }
    
    .tokens-grid {
        grid-template-columns: 1fr;
    }
    
    .wizard-content {
        padding: 24px;
    }
    
    .review-list,
    .detail-list {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .token-detail-content {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .wizard-steps {
        font-size: 12px;
    }
    
    .step-number {
        width: 32px;
        height: 32px;
    }
}

/* Token Detail Enhancements */
.detail-status-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-active {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-network {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    margin-left: 6px;
    opacity: 0.6;
    transition: opacity 0.2s;
    padding: 0;
    vertical-align: middle;
}

.copy-btn:hover { opacity: 1; }

.detail-description {
    font-style: italic;
    opacity: 0.8;
    font-size: 14px;
}

.loading-dots {
    opacity: 0.6;
    font-style: italic;
}

.detail-list dd {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

/* ==================== XAMAN QR Modal ==================== */

.xaman-modal .modal-content,
.xaman-modal-content {
    max-width: 420px;
    text-align: center;
}

.xaman-modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 24px 20px;
}

.xaman-modal-body p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

.xaman-qr-container {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.xaman-qr-img {
    width: 220px;
    height: 220px;
    display: block;
    border-radius: 4px;
}

.xaman-status {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 13px;
}

.xaman-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--gold-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

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

.xaman-deep-link {
    width: 100%;
    text-align: center;
    background: #1a5276;
    color: #fff;
    border: 1px solid #2471a3;
    font-size: 14px;
    padding: 12px 20px;
    border-radius: 8px;
    text-decoration: none;
    display: block;
}

.xaman-deep-link:hover {
    background: #2471a3;
}

.xaman-hint {
    font-size: 12px;
    color: var(--text-muted, #666);
    text-align: center;
    margin: 0;
}
