/* ===================================================
   QUICK CONNECT WIZARD - Full Screen Overlay Modal
   AlgoVesta API Keys Quick Connect
   =================================================== */

/* Overlay */
.qcw-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 50000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 16px;
}

.qcw-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.qcw-modal {
    width: 100%;
    max-width: 680px;
    max-height: 90vh;
    background: #0d1117;
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 212, 255, 0.05);
}

.qcw-overlay.active .qcw-modal {
    transform: translateY(0) scale(1);
}

/* Light theme */
[data-theme="light"] .qcw-modal {
    background: #ffffff;
    border-color: rgba(0, 150, 200, 0.2);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15), 0 0 40px rgba(0, 212, 255, 0.05);
}

/* Header */
.qcw-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

[data-theme="light"] .qcw-header {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

.qcw-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qcw-header-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 4px;
}

[data-theme="light"] .qcw-header-logo {
    background: #f8fafc;
    border-color: #e5e7eb;
}

.qcw-header-title {
    font-size: 1rem;
    font-weight: 600;
    color: #e2e8f0;
}

[data-theme="light"] .qcw-header-title {
    color: #1e293b;
}

.qcw-header-title span {
    color: #00d4ff;
}

.qcw-close-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 1.1rem;
}

.qcw-close-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

[data-theme="light"] .qcw-close-btn {
    border-color: #e5e7eb;
    background: #f8fafc;
    color: #64748b;
}

[data-theme="light"] .qcw-close-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* Progress Steps */
.qcw-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    gap: 0;
    flex-shrink: 0;
}

.qcw-step-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 500;
    color: #475569;
    transition: color 0.3s;
    white-space: nowrap;
}

.qcw-step-indicator.active {
    color: #00d4ff;
}

.qcw-step-indicator.done {
    color: #10b981;
}

.qcw-step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    transition: all 0.3s;
    flex-shrink: 0;
}

.qcw-step-indicator.active .qcw-step-dot {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.12);
    color: #00d4ff;
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.2);
}

.qcw-step-indicator.done .qcw-step-dot {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

[data-theme="light"] .qcw-step-dot {
    border-color: #cbd5e1;
}

[data-theme="light"] .qcw-step-indicator.active .qcw-step-dot {
    border-color: #0891b2;
    background: rgba(8, 145, 178, 0.1);
    color: #0891b2;
}

[data-theme="light"] .qcw-step-indicator.active {
    color: #0891b2;
}

.qcw-step-line {
    width: 32px;
    height: 2px;
    background: #334155;
    margin: 0 6px;
    border-radius: 1px;
    transition: background 0.3s;
    flex-shrink: 0;
}

.qcw-step-line.done {
    background: #10b981;
}

[data-theme="light"] .qcw-step-line {
    background: #e2e8f0;
}

/* Body - Scrollable */
.qcw-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    min-height: 0;
}

.qcw-body::-webkit-scrollbar {
    width: 5px;
}

.qcw-body::-webkit-scrollbar-track {
    background: transparent;
}

.qcw-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

/* Step Content Panels */
.qcw-step-panel {
    display: none;
    animation: qcwFadeIn 0.35s ease;
}

.qcw-step-panel.active {
    display: block;
}

@keyframes qcwFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Step 1 - Welcome */
.qcw-welcome-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.12), rgba(139, 92, 246, 0.08));
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #00d4ff;
}

.qcw-title {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 8px;
}

[data-theme="light"] .qcw-title {
    color: #1e293b;
}

.qcw-subtitle {
    text-align: center;
    font-size: 0.82rem;
    color: #64748b;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Checklist items */
.qcw-checklist {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.qcw-check-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    transition: all 0.2s;
}

.qcw-check-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .qcw-check-item {
    background: #f8fafc;
    border-color: #e5e7eb;
}

.qcw-check-icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.65rem;
    margin-top: 1px;
}

.qcw-check-icon.cyan {
    background: rgba(0, 212, 255, 0.12);
    color: #00d4ff;
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.qcw-check-icon.green {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.qcw-check-icon.orange {
    background: rgba(251, 146, 60, 0.12);
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.2);
}

.qcw-check-icon.red {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.qcw-check-text {
    flex: 1;
}

.qcw-check-text strong {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 2px;
}

[data-theme="light"] .qcw-check-text strong {
    color: #1e293b;
}

.qcw-check-text span {
    font-size: 0.73rem;
    color: #64748b;
    line-height: 1.4;
}

/* IP Box */
.qcw-ip-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(0, 212, 255, 0.05));
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    margin-bottom: 20px;
}

.qcw-ip-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qcw-ip-left i {
    color: #60a5fa;
    font-size: 0.9rem;
}

.qcw-ip-label {
    font-size: 0.73rem;
    color: #64748b;
}

.qcw-ip-value {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    color: #60a5fa;
    letter-spacing: 0.5px;
}

[data-theme="light"] .qcw-ip-value {
    color: #2563eb;
}

.qcw-ip-copy {
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    color: #60a5fa;
    font-size: 0.72rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.qcw-ip-copy:hover {
    background: rgba(59, 130, 246, 0.2);
}

/* Step 2 - Open Exchange */
.qcw-exchange-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    margin-bottom: 20px;
}

[data-theme="light"] .qcw-exchange-banner {
    background: #f8fafc;
    border-color: #e5e7eb;
}

.qcw-exchange-banner img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: contain;
}

.qcw-exchange-banner-info h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #e2e8f0;
    margin: 0 0 2px 0;
}

[data-theme="light"] .qcw-exchange-banner-info h3 {
    color: #1e293b;
}

.qcw-exchange-banner-info span {
    font-size: 0.73rem;
    color: #64748b;
}

/* Steps numbered instructions */
.qcw-instructions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.qcw-instruction {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.2s;
}

.qcw-instruction:hover {
    background: rgba(255, 255, 255, 0.04);
}

[data-theme="light"] .qcw-instruction {
    background: #fafbfc;
    border-color: #f1f5f9;
}

.qcw-instruction-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    color: #00d4ff;
    font-size: 0.68rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

[data-theme="light"] .qcw-instruction-num {
    background: rgba(8, 145, 178, 0.08);
    border-color: rgba(8, 145, 178, 0.2);
    color: #0891b2;
}

.qcw-instruction-text {
    font-size: 0.8rem;
    color: #cbd5e1;
    line-height: 1.5;
}

[data-theme="light"] .qcw-instruction-text {
    color: #475569;
}

.qcw-instruction-text strong {
    color: #e2e8f0;
    font-weight: 600;
}

[data-theme="light"] .qcw-instruction-text strong {
    color: #1e293b;
}

.qcw-instruction-text code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.73rem;
    background: rgba(0, 212, 255, 0.08);
    padding: 1px 6px;
    border-radius: 4px;
    color: #00d4ff;
    border: 1px solid rgba(0, 212, 255, 0.12);
}

[data-theme="light"] .qcw-instruction-text code {
    background: rgba(8, 145, 178, 0.06);
    color: #0891b2;
    border-color: rgba(8, 145, 178, 0.15);
}

/* Open Exchange Button */
.qcw-open-exchange-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #00d4ff, #0891b2);
    border: none;
    border-radius: 12px;
    color: #000;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    margin-bottom: 10px;
}

.qcw-open-exchange-btn:hover {
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
    transform: translateY(-1px);
}

.qcw-open-exchange-hint {
    text-align: center;
    font-size: 0.72rem;
    color: #475569;
    margin-bottom: 0;
}

.qcw-open-exchange-hint i {
    color: #00d4ff;
    margin-right: 4px;
}

/* Step 3 - Enter Keys */
.qcw-form-group {
    margin-bottom: 14px;
}

.qcw-form-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    color: #94a3b8;
    margin-bottom: 6px;
}

[data-theme="light"] .qcw-form-label {
    color: #64748b;
}

.qcw-form-label i {
    font-size: 0.7rem;
    color: #00d4ff;
}

[data-theme="light"] .qcw-form-label i {
    color: #0891b2;
}

.qcw-form-input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #e2e8f0;
    font-size: 0.85rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    transition: all 0.2s;
    box-sizing: border-box;
}

.qcw-form-input:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
    background: rgba(0, 0, 0, 0.45);
}

.qcw-form-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

[data-theme="light"] .qcw-form-input {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #1e293b;
}

[data-theme="light"] .qcw-form-input:focus {
    border-color: #0891b2;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.08);
}

[data-theme="light"] .qcw-form-input::placeholder {
    color: #94a3b8;
}

.qcw-form-input.pasted {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

.qcw-paste-hint {
    font-size: 0.68rem;
    color: #10b981;
    margin-top: 4px;
    display: none;
    align-items: center;
    gap: 4px;
}

.qcw-paste-hint.visible {
    display: flex;
}

/* Step 4 - Success */
.qcw-success-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(16, 185, 129, 0.05));
    border: 2px solid rgba(16, 185, 129, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #10b981;
    animation: qcwSuccessPulse 2s ease infinite;
}

@keyframes qcwSuccessPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.2); }
    50% { box-shadow: 0 0 0 12px rgba(16, 185, 129, 0); }
}

.qcw-success-title {
    text-align: center;
    font-size: 1.15rem;
    font-weight: 700;
    color: #10b981;
    margin-bottom: 8px;
}

.qcw-success-subtitle {
    text-align: center;
    font-size: 0.82rem;
    color: #64748b;
    margin-bottom: 24px;
    line-height: 1.5;
}

.qcw-success-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: 12px;
    margin-bottom: 20px;
}

.qcw-success-detail {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
}

.qcw-success-detail-label {
    color: #64748b;
}

.qcw-success-detail-value {
    color: #10b981;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
}

/* Footer / Actions */
.qcw-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    gap: 12px;
}

[data-theme="light"] .qcw-footer {
    border-top-color: rgba(0, 0, 0, 0.06);
}

.qcw-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    border: none;
}

.qcw-btn-back {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
}

.qcw-btn-back:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
}

[data-theme="light"] .qcw-btn-back {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: #64748b;
}

[data-theme="light"] .qcw-btn-back:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.qcw-btn-next {
    background: linear-gradient(135deg, #00d4ff, #0891b2);
    color: #000;
    font-weight: 700;
    margin-left: auto;
}

.qcw-btn-next:hover {
    box-shadow: 0 2px 12px rgba(0, 212, 255, 0.3);
    transform: translateY(-1px);
}

.qcw-btn-next:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.qcw-btn-save {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-weight: 700;
    margin-left: auto;
}

.qcw-btn-save:hover {
    box-shadow: 0 2px 12px rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
}

.qcw-btn-save:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.qcw-btn-done {
    background: linear-gradient(135deg, #00d4ff, #0891b2);
    color: #000;
    font-weight: 700;
    width: 100%;
    justify-content: center;
    padding: 12px;
}

.qcw-btn-done:hover {
    box-shadow: 0 2px 12px rgba(0, 212, 255, 0.3);
}

/* Loading spinner for save button */
.qcw-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: qcwSpin 0.6s linear infinite;
}

@keyframes qcwSpin {
    to { transform: rotate(360deg); }
}

/* Clipboard notification */
.qcw-clipboard-toast {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(16, 185, 129, 0.95);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    display: none;
    align-items: center;
    gap: 6px;
    animation: qcwToastIn 0.3s ease;
    z-index: 10;
    white-space: nowrap;
}

.qcw-clipboard-toast.visible {
    display: flex;
}

@keyframes qcwToastIn {
    from { transform: translateX(-50%) translateY(10px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .qcw-overlay {
        padding: 8px;
    }

    .qcw-modal {
        max-height: 95vh;
        border-radius: 16px;
    }

    .qcw-header {
        padding: 14px 16px;
    }

    .qcw-body {
        padding: 16px;
    }

    .qcw-footer {
        padding: 14px 16px;
    }

    .qcw-progress {
        padding: 12px 16px;
    }

    .qcw-step-indicator span {
        display: none;
    }

    .qcw-step-line {
        width: 24px;
    }

    .qcw-title {
        font-size: 1.05rem;
    }

    .qcw-form-input {
        font-size: 0.8rem;
        padding: 10px 12px;
    }
}
