/**
 * MoltChain Playground - Modal Styles
 * For wallet, settings, and other modals
 */

/* Modal Overlay */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Modal Content — matches wallet page card style */
.modal-content {
    background: #141830;
    border: 1px solid #1F2544;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

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

/* Modal Header */
.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #1F2544;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    margin: 0;
    color: #FFFFFF;
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-header h2 i {
    color: #FF6B35;
}

.modal-close {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: #6B7A99;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}

.modal-close:hover {
    color: #FF6B35;
    background: rgba(255, 255, 255, 0.08);
}

/* Modal Body */
.modal-body {
    padding: 2rem;
}

/* Wallet Specific Styles */
.wallet-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.wallet-info-display {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid #1F2544;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.wallet-address {
    margin-bottom: 1rem;
}

.wallet-address label {
    display: block;
    color: #B8C1EC;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.wallet-address code {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid #1F2544;
    border-radius: 10px;
    padding: 0.75rem;
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #FF6B35;
    word-break: break-all;
}

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

.wallet-balance label {
    display: block;
    color: #B8C1EC;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.wallet-balance h3 {
    margin: 0;
    font-size: 2rem;
    color: #00D9FF;
    font-weight: 700;
}

/* Settings Modal */
.settings-grid {
    display: grid;
    gap: 1.5rem;
}

.setting-group {
    border-bottom: 1px solid #1F2544;
    padding-bottom: 1.5rem;
}

.setting-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.setting-group h3 {
    color: #FFFFFF;
    font-size: 1.1rem;
    margin: 0 0 1rem 0;
}

.setting-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
}

.setting-option label {
    color: #B8C1EC;
    font-size: 0.95rem;
}

.setting-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.setting-option select {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid #1F2544;
    border-radius: 10px;
    color: #FFFFFF;
    padding: 0.5rem;
    cursor: pointer;
}

/* Modal Forms */
.modal-form-group {
    margin-bottom: 1.5rem;
}

.modal-form-group label {
    display: block;
    color: #B8C1EC;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.45rem;
}

.modal-form-group input,
.modal-form-group textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid #1F2544;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    color: #FFFFFF;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.modal-form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: 'JetBrains Mono', monospace;
    border-radius: 12px;
}

.modal-form-group input::placeholder,
.modal-form-group textarea::placeholder {
    color: #6B7A99;
}

.modal-form-group input:focus,
.modal-form-group textarea:focus {
    outline: none;
    border-color: #FF6B35;
    background: rgba(255, 107, 53, 0.04);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.12), 0 0 20px rgba(255, 107, 53, 0.06);
}

/* Seed Phrase Display */
.seed-phrase-container {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid #1F2544;
    border-radius: 14px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.seed-phrase-warning {
    background: rgba(255, 107, 53, 0.08);
    border: 1px solid rgba(255, 107, 53, 0.25);
    border-left: 3px solid #FF6B35;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 12px;
}

.seed-phrase-warning i {
    color: #FF6B35;
    margin-right: 0.5rem;
}

.seed-phrase-words {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
    margin-top: 1rem;
}

.seed-word {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid #1F2544;
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #FFFFFF;
    text-align: center;
    transition: border-color 0.2s;
}

.seed-word:hover {
    border-color: rgba(255, 107, 53, 0.3);
}

.seed-word-number {
    color: #6B7A99;
    font-size: 0.72rem;
    display: block;
    margin-bottom: 0.15rem;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-width: none;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .seed-phrase-words {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .modal-header {
        padding: 1rem;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .seed-phrase-words {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Wallet Modal — DEX-consistent design
   ═══════════════════════════════════════════════════════════════════════════ */
.wallet-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
}
.wallet-modal-overlay.hidden { display: none; }
.wallet-modal-content {
    background: #141830;
    border: 1px solid #1F2544;
    border-radius: 20px;
    width: 480px;
    max-width: 95vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.wallet-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px 14px;
}
.wallet-modal-header h3 { font-size: 1.3rem; font-weight: 700; margin: 0; }
.wallet-modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}
.wallet-modal-close:hover { color: var(--text-primary); background: var(--bg-hover); }

/* Wallet modal tabs — pill style */
.wallet-modal-tabs {
    display: flex;
    gap: 0.35rem;
    margin: 0 28px 4px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 0.3rem;
}
.wm-tab {
    flex: 1;
    padding: 0.6rem 0.5rem;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted, #6B7A99);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
}
.wm-tab:hover { color: var(--text-secondary); background: rgba(255, 255, 255, 0.04); }
.wm-tab.active {
    background: linear-gradient(135deg, #FF6B35 0%, #F77F00 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}
.wm-tab-content { padding: 24px 28px; }
.wm-tab-content.hidden { display: none; }
.wm-empty {
    text-align: center;
    padding: 30px 20px;
}
.wm-empty i { font-size: 2.5rem; color: var(--text-muted, #6B7A99); margin-bottom: 12px; display: block; }
.wm-empty p { color: var(--text-muted, #6B7A99); margin-bottom: 16px; }
.wm-wallet-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    margin-bottom: 8px;
    border: 1px solid #1F2544;
    transition: border-color 0.2s;
}
.wm-wallet-item:hover { border-color: rgba(255, 107, 53, 0.3); }
.wm-wallet-item.active-wallet { border-color: var(--orange-primary); background: rgba(255, 107, 53, 0.05); }
.wm-wallet-addr { font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; }
.wm-wallet-item .btn-small { font-size: 0.72rem; padding: 0.3rem 0.6rem; border-radius: 8px; }
.wm-wallet-actions { display: flex; gap: 6px; }

/* Import toggle — pill style */
.wm-import-toggle {
    display: flex;
    gap: 0.35rem;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 18px;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.3rem;
}
.wm-import-type {
    flex: 1;
    padding: 0.55rem 0.5rem;
    text-align: center;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--text-muted, #6B7A99);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.25s ease;
    font-family: inherit;
}
.wm-import-type:hover { color: var(--text-secondary); background: rgba(255, 255, 255, 0.04); }
.wm-import-type.active {
    background: linear-gradient(135deg, #FF6B35 0%, #F77F00 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

/* Form inputs in wallet modal */
.wallet-modal-content .form-group { margin-bottom: 1.25rem; }
.wallet-modal-content .form-group label {
    display: block;
    font-size: 0.85rem;
    color: #B8C1EC;
    letter-spacing: normal;
    text-transform: none;
    font-weight: 500;
    margin-bottom: 0.45rem;
}
.wallet-modal-content .form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid #1F2544;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
    outline: none;
    box-sizing: border-box;
}
.wallet-modal-content .form-input::placeholder { color: #6B7A99; }
.wallet-modal-content .form-input:focus {
    border-color: #FF6B35;
    background: rgba(255, 107, 53, 0.04);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.12), 0 0 20px rgba(255, 107, 53, 0.06);
}

/* Modal buttons */
.wallet-modal-content .btn-full {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    margin-top: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.wallet-modal-content .btn-full.btn-primary {
    background: linear-gradient(135deg, #FF6B35 0%, #F77F00 100%);
    color: white;
}
.wallet-modal-content .btn-full.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.3);
}

/* Mnemonic grid */
.mnemonic-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
}
.mnemonic-grid input {
    padding: 0.55rem 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid #1F2544;
    border-radius: 10px;
    color: #fff;
    font-size: 0.85rem;
    font-family: 'JetBrains Mono', monospace;
    outline: none;
    text-align: center;
    transition: border-color 0.25s, box-shadow 0.25s;
}
.mnemonic-grid input::placeholder { font-size: 0.7rem; color: #6B7A99; }
.mnemonic-grid input:focus {
    border-color: #FF6B35;
    background: rgba(255, 107, 53, 0.04);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.12), 0 0 20px rgba(255, 107, 53, 0.06);
}
.wm-create-info {
    text-align: center;
    padding: 16px 0;
}
.wm-create-info i { font-size: 2rem; color: var(--orange-primary); margin-bottom: 12px; display: block; }
.wm-create-info h4 { margin-bottom: 6px; }
.wm-create-info p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px; }
#wmCreateBtn { margin-bottom: 16px; }
.wm-generated-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.65rem 0.85rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    margin-bottom: 8px;
    border: 1px solid #1F2544;
}
.wm-label {
    font-size: 0.7rem;
    color: var(--text-muted, #6B7A99);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    min-width: 80px;
}
.wm-value {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    word-break: break-all;
}
.wm-secret { filter: blur(4px); transition: filter 0.2s; cursor: pointer; }
.wm-secret:hover { filter: none; }
.wm-copy-btn { flex-shrink: 0; }
.wm-warning {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.2rem;
    background: rgba(255, 107, 53, 0.08);
    border: 1px solid rgba(255, 107, 53, 0.25);
    border-radius: 12px;
    margin-top: 12px;
    color: var(--yellow-warning);
    font-size: 0.8rem;
}
.wm-disconnect-all {
    margin-top: 12px;
    text-align: center;
}
