/**
 * Stellar Wallet Creator Styles
 * Enhanced with Modal Overlay and Safety Features
 * 
 * Version: 2.0.0
 */

/* ============================================
   Modal Overlay - Full Screen
   ============================================ */

.wallet-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    overflow-y: auto;
    animation: fadeIn 0.3s ease-in;
}

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

.wallet-modal {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    max-width: 700px;
    width: 100%;
    max-height: 95vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s ease-out;
}

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

/* ============================================
   Modal Header
   ============================================ */

.modal-header {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    text-align: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.modal-header h2 {
    color: white;
    margin: 15px 0;
    font-size: 32px;
    font-weight: bold;
}

.success-icon-large {
    font-size: 64px;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.warning-pulse {
    background: #ef4444;
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 18px;
    display: inline-block;
    margin-top: 15px;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 30px rgba(239, 68, 68, 0.8);
    }
}

/* ============================================
   Modal Body
   ============================================ */

.modal-body {
    padding: 30px;
    background: white;
}

/* ============================================
   Credentials Box
   ============================================ */

.credentials-box {
    background: #f8fafc;
    border: 3px solid #e2e8f0;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
}

.credential-item {
    margin-bottom: 20px;
}

.credential-item:last-child {
    margin-bottom: 0;
}

.credential-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    font-size: 14px;
    color: #475569;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.label-icon {
    font-size: 18px;
}

.critical-label {
    color: #dc2626;
}

.credential-value-container {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
}

.critical-item .credential-value-container {
    border-color: #fca5a5;
    background: #fef2f2;
}

.credential-value {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    word-break: break-all;
    color: #1e293b;
    line-height: 1.6;
}

.public-key {
    color: #0891b2;
}

.secret-key {
    color: #dc2626;
    font-weight: bold;
}

.secret-blur {
    filter: blur(8px);
    user-select: none;
    cursor: pointer;
}

.secret-blur:hover {
    filter: blur(6px);
}

/* ============================================
   Icon Buttons
   ============================================ */

.btn-icon {
    background: #64748b;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    min-width: 40px;
}

.btn-icon:hover {
    background: #475569;
    transform: scale(1.1);
}

.btn-icon:active {
    transform: scale(0.95);
}

/* ============================================
   Wallet Info Grid
   ============================================ */

.wallet-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.info-item {
    background: #f1f5f9;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-icon {
    font-size: 28px;
}

.info-content {
    flex: 1;
}

.info-label {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
}

.info-content strong {
    font-size: 16px;
    color: #1e293b;
}

/* ============================================
   Critical Warning Box
   ============================================ */

.critical-warning-box {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 3px solid #ef4444;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.1);
}

.warning-icon-large {
    font-size: 48px;
    animation: shake 3s ease-in-out infinite;
}

@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

.warning-content h3 {
    color: #dc2626;
    margin: 0 0 10px 0;
    font-size: 20px;
}

.warning-content p {
    margin: 8px 0;
    color: #7f1d1d;
    line-height: 1.6;
}

.warning-emphasis {
    font-weight: bold;
    font-size: 16px;
    color: #991b1b !important;
}

/* ============================================
   Modal Actions
   ============================================ */

.modal-actions {
    background: #f8fafc;
    padding: 25px 30px;
    border-top: 2px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
}

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.btn-primary.btn-large {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.btn-primary.btn-large:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.4);
}

.btn-success.btn-large {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
}

.btn-success.btn-large:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.4);
}

.btn-success.btn-large:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-pulse {
    animation: buttonPulse 2s ease-in-out infinite;
}

@keyframes buttonPulse {
    0%, 100% {
        box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.3);
    }
    50% {
        box-shadow: 0 10px 25px -3px rgba(16, 185, 129, 0.6);
    }
}

.action-hint {
    text-align: center;
    font-size: 14px;
    color: #64748b;
    margin: 0;
    padding: 10px;
    background: white;
    border-radius: 8px;
}

/* ============================================
   Modal Footer
   ============================================ */

.modal-footer {
    padding: 20px 30px;
    background: rgba(0, 0, 0, 0.03);
    border-top: 1px solid #e2e8f0;
}

.footer-text {
    text-align: center;
    color: #64748b;
    font-size: 14px;
    margin: 0;
}

/* ============================================
   Original Inline Styles (for non-modal steps)
   ============================================ */

.wallet-creator {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 0;
    margin: 30px 0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.wallet-creator-header {
    background: rgba(255, 255, 255, 0.1);
    padding: 25px;
    text-align: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.wallet-creator-header h3 {
    color: white;
    margin: 0 0 10px 0;
    font-size: 24px;
}

.wallet-creator-header p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
}

.wallet-creator-body {
    background: white;
    padding: 30px;
}

/* ============================================
   Initial Step
   ============================================ */

.wallet-initial h4 {
    color: #1e293b;
    margin: 0 0 15px 0;
}

.wallet-features {
    display: grid;
    gap: 15px;
    margin: 25px 0;
}

.feature {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: #f1f5f9;
    border-radius: 10px;
}

.feature-icon {
    font-size: 24px;
}

.feature-text {
    font-size: 15px;
    color: #475569;
}

.wallet-actions {
    display: flex;
    gap: 12px;
    margin: 25px 0;
}

.btn {
    flex: 1;
    padding: 14px 24px;
    border-radius: 8px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
}

.btn-secondary {
    background: #e2e8f0;
    color: #475569;
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.wallet-info {
    margin-top: 25px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 10px;
    border-left: 4px solid #3b82f6;
}

.text-muted {
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
}

/* ============================================
   Creating Step
   ============================================ */

.wallet-creating {
    text-align: center;
    padding: 40px 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.wallet-creating h4 {
    color: #1e293b;
    margin-bottom: 30px;
}

.creation-steps {
    text-align: left;
    max-width: 400px;
    margin: 0 auto;
}

.step {
    padding: 12px;
    margin: 8px 0;
    border-radius: 8px;
    background: #f1f5f9;
    color: #94a3b8;
}

.step.completed {
    background: #dcfce7;
    color: #166534;
}

.step.active {
    background: #dbeafe;
    color: #1e40af;
    font-weight: 600;
}

/* ============================================
   Error Step
   ============================================ */

.wallet-error {
    text-align: center;
    padding: 40px 20px;
}

.error-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.wallet-error h4 {
    color: #dc2626;
    margin-bottom: 15px;
}

.wallet-error p {
    color: #64748b;
    margin-bottom: 25px;
}

/* ============================================
   Mobile Responsive
   ============================================ */

@media (max-width: 768px) {
    .wallet-modal {
        max-width: 100%;
        border-radius: 0;
        max-height: 100vh;
    }
    
    .modal-header h2 {
        font-size: 24px;
    }
    
    .success-icon-large {
        font-size: 48px;
    }
    
    .warning-pulse {
        font-size: 14px;
        padding: 10px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .credentials-box {
        padding: 15px;
    }
    
    .credential-value {
        font-size: 11px;
    }
    
    .critical-warning-box {
        flex-direction: column;
        text-align: center;
    }
    
    .warning-icon-large {
        font-size: 36px;
    }
    
    .wallet-actions {
        flex-direction: column;
    }
    
    .btn-large {
        padding: 14px 24px;
        font-size: 16px;
    }
    
    .wallet-info-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Print Styles (hide wallet creator)
   ============================================ */

@media print {
    .wallet-modal-overlay,
    .wallet-creator {
        display: none !important;
    }
}
