/* Onboarding Wizard Styles */

.psg-onboarding-container {
    width: 100%;
    margin: 0 auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Progress Indicator */
.psg-onboarding-progress {
    margin-bottom: 40px;
}

.psg-progress-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    margin-bottom: 10px;
}

.psg-progress-line {
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    height: 4px;
    background: #e0e0e0;
    z-index: 1;
}

.psg-progress-fill {
    height: 100%;
    background: #0073aa;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.psg-progress-step {
    position: relative;
    z-index: 2;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: #9ca3af;
    transition: all 0.3s ease;
}

.psg-progress-step.active {
    border-color: #0073aa;
    color: #0073aa;
    background: #fff;
}

.psg-progress-step.completed {
    border-color: #0073aa;
    background: #0073aa;
    color: #fff;
}

.psg-progress-step.completed::after {
    content: '✓';
}

.psg-progress-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}

.psg-progress-label {
    font-size: 13px;
    color: #6b7280;
    text-align: center;
    flex: 1;
}

.psg-progress-step.active + .psg-progress-label {
    color: #333;
    font-weight: 600;
}

/* Wizard Card */
.psg-onboarding-wizard {
    background: #fff;
    border-radius: 6px;
    padding: 0;
}

/* Steps */
.psg-onboarding-step {
    display: none;
}

.psg-onboarding-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.psg-step-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.psg-step-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    background: #0073aa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.psg-step-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px;
}

.psg-step-header p {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* Form Elements */
.psg-form-group {
    margin-bottom: 20px;
}

.psg-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}

.psg-form-group input[type="url"],
.psg-form-group textarea,
.psg-form-group select {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.2s;
    font-family: inherit;
    box-sizing: border-box;
}

.psg-form-group input[type="url"]:focus,
.psg-form-group textarea:focus,
.psg-form-group select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.psg-form-group textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.5;
}

.psg-form-help {
    font-size: 13px;
    color: #999;
    margin-top: 5px;
}

/* Image Style Cards */
.psg-image-style-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 12px;
}

.psg-image-style-card {
    border: 2px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f9f9f9;
}

.psg-image-style-card:hover {
    border-color: #0073aa;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1);
}

.psg-image-style-card.selected {
    border-color: #0073aa;
    background: #f0f6fc;
}

.psg-image-style-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.psg-image-style-card h4 {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px;
}

.psg-image-style-card p {
    font-size: 13px;
    color: #666;
    margin: 0;
}

/* Messages */
.psg-onboarding-message {
    display: none;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
}

.psg-onboarding-message.success {
    background: #edfaef;
    color: #00a32a;
    border-left: 4px solid #00a32a;
}

.psg-onboarding-message.error {
    background: #fcf0f1;
    color: #d63638;
    border-left: 4px solid #d63638;
}

.psg-onboarding-message.info {
    background: #f0f6fc;
    color: #0073aa;
    border-left: 4px solid #0073aa;
}

.psg-onboarding-message p {
    margin: 0;
}

/* Loading Spinner */
.psg-onboarding-loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.psg-loading-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.psg-loading-text {
    margin-top: 10px;
    font-size: 14px;
    color: #0073aa;
    font-weight: 500;
}

/* Actions */
.psg-onboarding-actions {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 2px solid #f0f0f0;
}

.psg-onboarding-actions button {
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.psg-onboarding-actions button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#psg-onboarding-back {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #ddd;
}

#psg-onboarding-back:hover:not(:disabled) {
    background: #e5e7eb;
}

#psg-onboarding-next,
#psg-onboarding-scan,
#psg-onboarding-finish {
    background: #0073aa;
    color: #fff;
    margin-left: auto;
}

#psg-onboarding-next:hover:not(:disabled),
#psg-onboarding-scan:hover:not(:disabled),
#psg-onboarding-finish:hover:not(:disabled) {
    background: #005a87;
}

/* Completion State */
.psg-onboarding-complete {
    text-align: center;
    padding: 48px 40px;
}

.psg-onboarding-complete h2 {
    font-size: 26px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px;
}

.psg-onboarding-complete p {
    font-size: 15px;
    color: #666;
    margin: 0 0 28px;
}

.psg-btn {
    display: inline-block;
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.psg-btn-primary {
    background: #0073aa;
    color: #fff;
}

.psg-btn-primary:hover {
    background: #005a87;
}

/* Responsive */
@media (max-width: 768px) {
    .psg-onboarding-container {
        padding: 20px 16px;
    }

    .psg-step-header {
        flex-direction: column;
        text-align: center;
    }

    .psg-image-style-grid {
        grid-template-columns: 1fr;
    }

    .psg-onboarding-actions {
        flex-direction: column;
    }

    .psg-onboarding-actions button {
        width: 100%;
    }

    #psg-onboarding-next,
    #psg-onboarding-scan,
    #psg-onboarding-finish {
        margin-left: 0;
        order: -1;
    }
}

/* Blueprint Preview */
.psg-blueprint-preview {
    margin: 28px 0;
}

.psg-blueprint-layout {
    display: grid;
    grid-template-columns: minmax(500px, 1fr) 280px;
    gap: 24px;
    align-items: start;
}

.psg-blueprint-image-col {
    position: sticky;
    top: 16px;
}

.psg-blueprint-image-col img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid #ddd;
    margin-bottom: 12px;
}

.psg-blueprint-text-col .psg-article-preview {
    max-height: 600px;
}

.psg-article-preview {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    border-left: 4px solid #0073aa;
    padding: 24px;
    margin-bottom: 0;
    max-height: 500px;
    overflow-y: auto;
}

.psg-article-edit-hint {
    font-size: 12px;
    color: #999;
    margin-bottom: 12px;
    text-align: right;
}

.psg-article-content[contenteditable="true"] {
    outline: none;
}

.psg-article-content[contenteditable="true"]:focus {
    box-shadow: none;
}

.psg-article-content h1 {
    font-size: 28px;
    font-weight: 600;
    color: #333;
    margin: 0 0 16px;
}

.psg-article-content h2 {
    font-size: 22px;
    font-weight: 600;
    color: #444;
    margin: 24px 0 12px;
}

.psg-article-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: #555;
    margin: 20px 0 10px;
}

.psg-article-content p {
    font-size: 15px;
    line-height: 1.8;
    color: #666;
    margin: 0 0 15px;
}

.psg-image-actions {
    margin-top: 12px;
    text-align: center;
}

.psg-btn-secondary {
    background: #2271b1;
    color: #fff;
    border: none;
}

.psg-btn-secondary:hover:not(:disabled) {
    background: #135e96;
}

.psg-blueprint-complete {
    background: #edfaef;
    border: 1px solid #00a32a;
    border-left: 4px solid #00a32a;
    border-radius: 4px;
    padding: 14px 18px;
    margin-top: 20px;
}

/* Completion Actions */
.psg-completion-actions {
    margin-top: 24px;
    text-align: center;
}

/* Edit Mode Actions */
.psg-edit-mode-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.psg-btn-link {
    background: transparent;
    color: #0073aa;
    border: none;
    padding: 8px 0;
    font-size: 14px;
    cursor: pointer;
}

.psg-btn-link:hover {
    color: #005a87;
    text-decoration: underline;
}

.psg-blueprint-complete p {
    margin: 4px 0;
    color: #00a32a;
    font-size: 14px;
}

.psg-blueprint-complete strong {
    font-size: 15px;
}


