/**
 * vNext Results Panel Styles
 *
 * Styles for the artifact results panel in vNext workflow.
 *
 * @package WP_AI_Connector
 * @since 1.1.0
 */

/* Results Panel Container */
.ai-deals-vnext-results {
    margin: 20px 0;
    padding: 40px;
    background: rgba(15, 20, 45, 0.2);
    border: 1px solid rgba(200, 150, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(200, 150, 255, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
    color: #a0d8ff;
}

/* Text content in results */
.ai-deals-vnext-results p,
.ai-deals-vnext-results span,
.ai-deals-vnext-results div,
.ai-deals-vnext-results li {
    color: #a0d8ff;
}

.ai-deals-vnext-results h1,
.ai-deals-vnext-results h2 {
    color: #c896ff;
    font-weight: 700;
}

.ai-deals-vnext-results strong {
    color: #c896ff;
    font-weight: 700;
}

.ai-deals-vnext-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(200, 150, 255, 0.2);
}

.ai-deals-vnext-results-header h3 {
    margin: 0;
    font-size: 18px;
    color: #c896ff;
    font-weight: 700;
}

.ai-deals-results-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.ai-deals-results-sort {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #a0d8ff;
}

.ai-deals-sort-artifacts {
    padding: 6px 8px;
    border: 1px solid rgba(200, 150, 255, 0.3);
    border-radius: 6px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.05);
    color: #a0d8ff;
}

/* Bulk Actions */
.ai-deals-bulk-actions {
    display: flex;
    gap: 10px;
}

.ai-deals-save-all,
.ai-deals-rerun,
.ai-deals-restart {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-deals-save-all {
    background: linear-gradient(135deg, #c896ff, #7b5bff);
    color: #fff;
    border: 1px solid rgba(200, 150, 255, 0.3);
    font-weight: 600;
}

.ai-deals-save-all:hover {
    background: linear-gradient(135deg, #d9a8ff, #8b6bff);
    box-shadow: 0 0 15px rgba(200, 150, 255, 0.3);
}

.ai-deals-save-all:disabled {
    background: rgba(200, 150, 255, 0.2);
    cursor: not-allowed;
    opacity: 0.5;
}

.ai-deals-rerun {
    background: rgba(255, 255, 255, 0.05);
    color: #a0d8ff;
    border: 1px solid rgba(200, 150, 255, 0.3);
}

.ai-deals-rerun:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(200, 150, 255, 0.5);
}

.ai-deals-restart {
    background: rgba(255, 255, 255, 0.05);
    color: #a0d8ff;
    border: 1px solid rgba(200, 150, 255, 0.3);
}
}

.ai-deals-restart:hover {
    background: #f6f7f7;
}

/* Artifacts List */
.ai-deals-artifacts-list {
    display: grid;
    gap: 15px;
}

.ai-deals-artifact-item {
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(200, 150, 255, 0.2);
    border-left: 4px solid #c896ff;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.ai-deals-artifact-item.saved {
    border-left-color: #46b450;
    background: rgba(70, 180, 80, 0.1);
    border-color: rgba(70, 180, 80, 0.3);
}

/* Artifact Header */
.ai-deals-artifact-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.ai-deals-artifact-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.ai-deals-artifact-title {
    font-weight: 600;
    font-size: 15px;
    color: #c896ff;
    margin: 0;
    flex: 1;
    min-width: 0;
}

.ai-deals-artifact-meta {
    display: flex;
    gap: 12px;
    align-items: center;
}

.ai-deals-artifact-fact {
    background: rgba(200, 150, 255, 0.2);
    color: #c896ff;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.ai-deals-artifact-identifiers {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #a0d8ff;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.ai-deals-artifact-select {
    display: flex;
    align-items: center;
    margin: 0;
}

.ai-deals-artifact-select input {
    margin: 0;
}

.ai-deals-artifact-type {
    padding: 4px 8px;
    background: rgba(200, 150, 255, 0.15);
    border-radius: 6px;
    font-size: 12px;
    color: #a0d8ff;
}

.ai-deals-artifact-status {
    padding: 4px 8px;
    background: #c896ff;
    border-radius: 6px;
    font-size: 12px;
    color: #0a0e27;
    font-weight: 600;
}

.ai-deals-artifact-status.status-saved {
    background: #46b450;
    color: #fff;
}

/* Artifact Preview */
.ai-deals-artifact-preview {
    margin: 12px 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(200, 150, 255, 0.2);
    border-radius: 8px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    max-height: 300px;
    overflow: auto;
    color: #a0d8ff;
}

.ai-deals-artifact-preview pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #a0d8ff;
}

.ai-deals-artifact-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.ai-deals-artifact-preview a {
    color: #c896ff;
    text-decoration: none;
}

.ai-deals-artifact-preview a:hover {
    text-decoration: underline;
    color: #d9a8ff;
}

.ai-deals-artifact-utility {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.ai-deals-artifact-utility button,
.ai-deals-artifact-utility a {
    padding: 6px 12px;
    border: 1px solid rgba(200, 150, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: #a0d8ff;
    text-decoration: none;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-deals-artifact-utility button:hover,
.ai-deals-artifact-utility a:hover {
    background: rgba(200, 150, 255, 0.1);
    border-color: rgba(200, 150, 255, 0.5);
}

/* Artifact Grouping */
.ai-deals-artifact-group {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #a0d8ff;
}

.ai-deals-artifact-fact-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #a0d8ff;
}

.ai-deals-artifact-group-select {
    padding: 4px 8px;
    border: 1px solid rgba(200, 150, 255, 0.3);
    border-radius: 6px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: #a0d8ff;
}

.ai-deals-edit-artifact {
    padding: 4px 10px;
    border: 1px solid rgba(200, 150, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    font-size: 12px;
    color: #a0d8ff;
}

.ai-deals-artifact-edit {
    margin-top: 12px;
    padding: 10px;
    border: 1px dashed rgba(200, 150, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-deals-artifact-edit input,
.ai-deals-artifact-edit textarea {
    width: 100%;
    max-width: 100%;
    border: 1px solid rgba(200, 150, 255, 0.3);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.05);
    color: #a0d8ff;
}

.ai-deals-artifact-edit input::placeholder,
.ai-deals-artifact-edit textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.ai-deals-artifact-edit-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ai-deals-artifact-edit-actions button {
    padding: 6px 12px;
    border: 1px solid rgba(200, 150, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    font-size: 12px;
    color: #a0d8ff;
}

.ai-deals-artifact-edit-note {
    margin: 0;
    font-size: 12px;
    color: #a0d8ff;
    opacity: 0.8;
}

.ai-deals-results-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-deals-results-subtitle {
    margin: 4px 0 0;
    font-size: 12px;
    color: #a0d8ff;
    opacity: 0.8;
}

/* Artifact Actions */
.ai-deals-artifact-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* Handoff controls */
.ai-deals-handoff-controls {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed rgba(200, 150, 255, 0.3);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.ai-deals-select-all {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #a0d8ff;
}

.ai-deals-continue-with {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.ai-deals-continue-agent-search,
.ai-deals-browser-agent-search {
    width: 100%;
    max-width: 260px;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
}

.ai-deals-continue-agent {
    min-width: 220px;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
}

.ai-deals-continue-agent-btn {
    padding: 7px 14px;
    border: none;
    border-radius: 4px;
    background: #2271b1;
    color: #fff;
    cursor: pointer;
}

.ai-deals-continue-agent-btn[data-target="new"] {
    background: #50575e;
}

/* Multi-step controls */
.ai-deals-multistep-controls {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e5e5e5;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-deals-multistep-feedback {
    width: 100%;
    min-height: 70px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
}

.ai-deals-continue-run {
    align-self: flex-start;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    background: #2271b1;
    color: #fff;
    cursor: pointer;
}

.ai-deals-continue-run:hover {
    background: #135e96;
}

.ai-deals-save-artifact,
.ai-deals-delete-artifact {
    padding: 6px 14px;
    border: none;
    border-radius: 3px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-deals-save-artifact {
    background: #0073aa;
    color: #fff;
}

.ai-deals-save-artifact:hover {
    background: #005a87;
}

.ai-deals-save-artifact:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.ai-deals-delete-artifact {
    background: #dc3232;
    color: #fff;
}

.ai-deals-delete-artifact:hover {
    background: #a00;
}

.ai-deals-delete-artifact:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Notices */
.ai-deals-notice {
    padding: 12px 16px;
    margin: 15px 0;
    border-radius: 4px;
    font-size: 14px;
    animation: slideIn 0.3s ease;
}

.ai-deals-notice-success {
    background: #ecf7ed;
    border-left: 4px solid #46b450;
    color: #2e7d32;
}

.ai-deals-notice-error {
    background: #fef7f1;
    border-left: 4px solid #dc3232;
    color: #a00;
}

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

/* Empty State */
.ai-deals-no-artifacts {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.ai-deals-no-artifacts p {
    margin: 0;
    font-size: 15px;
}

/* Run Info */
.ai-deals-run-info {
    margin-bottom: 20px;
    padding: 12px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 13px;
    color: #666;
}

.ai-deals-run-info strong {
    color: #333;
}

/* Artifact Browser (pre-run) */
.ai-deals-browser {
    margin: 20px 0;
    padding: 12px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    background: #fff;
}

.ai-deals-browser-toggle {
    padding: 6px 12px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    background: #f6f7f7;
    cursor: pointer;
}

.ai-deals-browser-panel {
    margin-top: 12px;
}

.ai-deals-browser-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
}

.ai-deals-browser-search {
    flex: 1;
    min-width: 180px;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.ai-deals-entity-search {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    margin-bottom: 6px;
}

.ai-deals-browser-type {
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.ai-deals-browser-sort {
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.ai-deals-browser-list {
    display: grid;
    gap: 8px;
}

.ai-deals-browser-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    border: 1px solid #eee;
    border-radius: 6px;
    background: #fafafa;
}

.ai-deals-browser-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.ai-deals-browser-checkbox {
    margin: 0;
}

.ai-deals-browser-title {
    font-size: 13px;
    color: #333;
}

.ai-deals-browser-type-label {
    font-size: 12px;
    color: #666;
    background: #e8e8e8;
    padding: 2px 6px;
    border-radius: 3px;
}

.ai-deals-browser-tray {
    margin-top: 12px;
    border-top: 1px dashed #e5e5e5;
    padding-top: 10px;
}

.ai-deals-browser-tray-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ai-deals-browser-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.ai-deals-browser-chip {
    background: #eef5ff;
    border: 1px solid #cfe0f5;
    color: #1d3f6e;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-deals-browser-remove {
    background: transparent;
    border: none;
    color: #a00;
    cursor: pointer;
    font-weight: 700;
}

.ai-deals-browser-actions {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.ai-deals-browser-agent {
    min-width: 200px;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.ai-deals-browser-loading,
.ai-deals-browser-empty {
    font-size: 13px;
    color: #666;
    padding: 8px 0;
}

.ai-deals-handoff-empty {
    font-size: 13px;
    color: #666;
    padding: 8px;
    border: 1px dashed #ddd;
    border-radius: 6px;
    background: #fdfdfd;
}

.ai-deals-handoff-load-previous {
    padding: 6px 12px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    background: #f6f7f7;
    cursor: pointer;
    font-size: 12px;
}

/* Responsive */
@media (max-width: 782px) {
    .ai-deals-vnext-results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .ai-deals-bulk-actions {
        width: 100%;
    }

    .ai-deals-save-all,
    .ai-deals-rerun {
        flex: 1;
    }

    .ai-deals-artifact-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .ai-deals-artifact-actions {
        width: 100%;
    }

    .ai-deals-save-artifact,
    .ai-deals-delete-artifact {
        flex: 1;
    }

    .ai-deals-handoff-controls,
    .ai-deals-continue-with {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    .ai-deals-continue-agent {
        width: 100%;
    }
}
