/* ============================================================================
   Orchestration Wizard Styles
   ============================================================================ */

/* Wizard Progress Indicator */
.wizard-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.wizard-progress::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: #e9ecef;
    z-index: 0;
}

.wizard-step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
    cursor: default;
}

.wizard-step.clickable {
    cursor: pointer;
}

.wizard-step.clickable:hover .step-number {
    transform: scale(1.1);
}

.wizard-step .step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
}

.wizard-step.active .step-number {
    background: #0d6efd;
    color: white;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.2);
    transform: scale(1.05);
}

.wizard-step.completed .step-number {
    background: #198754;
    color: white;
}

.wizard-step .step-label {
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
}

.wizard-step.active .step-label {
    color: #0d6efd;
    font-weight: 600;
}

.wizard-step.completed .step-label {
    color: #198754;
}

/* Wizard Content Area */
.wizard-content {
    min-height: 400px;
    padding: 2rem 1rem;
}

.wizard-step-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #212529;
}

.wizard-step-description {
    color: #6c757d;
    margin-bottom: 2rem;
}

/* Wizard Navigation Buttons */
.wizard-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.wizard-nav .btn {
    min-width: 120px;
}

/* Validation Checklist */
.validation-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
}

.validation-checklist li {
    padding: 16px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: background-color 0.2s;
}

.validation-checklist li:hover {
    background-color: #f8f9fa;
}

.validation-checklist li:last-child {
    border-bottom: none;
}

.validation-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.validation-icon.success {
    background: #198754;
    color: white;
}

.validation-icon.error {
    background: #dc3545;
    color: white;
}

.validation-icon.pending {
    background: #6c757d;
    color: white;
}

.validation-icon.spinner {
    background: transparent;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0d6efd;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.validation-text {
    flex: 1;
}

.validation-label {
    font-weight: 500;
    color: #212529;
    margin-bottom: 4px;
}

.validation-detail {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Clarity Meter */
.clarity-meter {
    position: relative;
    height: 40px;
    background: #e9ecef;
    border-radius: 20px;
    overflow: hidden;
    margin: 1rem 0;
}

.clarity-meter-fill {
    height: 100%;
    transition: width 0.8s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    position: relative;
}

.clarity-meter-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.clarity-low { 
    background: linear-gradient(90deg, #dc3545, #fd7e14);
}

.clarity-medium { 
    background: linear-gradient(90deg, #fd7e14, #ffc107);
}

.clarity-high { 
    background: linear-gradient(90deg, #ffc107, #198754);
}

.clarity-excellent { 
    background: linear-gradient(90deg, #198754, #20c997);
}

/* Goal Refinement Results */
.refinement-result {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.refinement-section {
    margin-bottom: 1.5rem;
}

.refinement-section:last-child {
    margin-bottom: 0;
}

.refinement-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.refinement-content {
    color: #212529;
}

.refinement-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.refinement-list li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
}

.refinement-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #0d6efd;
    font-weight: bold;
}

.token-cost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 4px 12px;
    font-size: 0.875rem;
    color: #856404;
}

/* Loading States */
.wizard-loading {
    text-align: center;
    padding: 60px 20px;
}

.wizard-loading .spinner-border {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
    border-width: 0.3rem;
}

.wizard-loading-text {
    font-size: 1.125rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.wizard-loading-subtext {
    font-size: 0.875rem;
    color: #adb5bd;
}

/* Review Summary Cards */
.review-summary {
    display: grid;
    gap: 1rem;
}

.review-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.25rem;
}

.review-card-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.review-card-title i {
    color: #198754;
}

.review-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f5;
}

.review-item:last-child {
    border-bottom: none;
}

.review-label {
    color: #6c757d;
    font-size: 0.875rem;
}

.review-value {
    color: #212529;
    font-weight: 500;
    text-align: right;
}

/* ProjectA4 Info Display */
.project-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.project-info-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1rem;
}

.project-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.project-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.project-type {
    font-size: 0.875rem;
    opacity: 0.9;
}

.project-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.project-stat {
    flex: 1;
}

.project-stat-label {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-bottom: 4px;
}

.project-stat-value {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wizard-progress {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .wizard-step {
        flex: 1 1 calc(33.333% - 1rem);
        min-width: 80px;
    }
    
    .wizard-step .step-label {
        font-size: 0.75rem;
    }
    
    .wizard-nav {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .wizard-nav .btn {
        width: 100%;
    }
    
    .project-stats {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Alert Styles for Wizard */
.wizard-alert {
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.wizard-alert-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.wizard-alert-content {
    flex: 1;
}

.wizard-alert-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.wizard-alert-message {
    font-size: 0.875rem;
}

/* ============================================================================
   Folder Browser (Step 2)
   ============================================================================ */

.folder-browser-container {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.folder-browser-nav {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.folder-browser-nav .breadcrumb-path {
    display: flex;
    align-items: center;
    flex: 1;
    overflow: hidden;
}

.folder-browser-nav .breadcrumb-items {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
}

.folder-browser-nav .breadcrumb-link {
    color: #0d6efd;
    text-decoration: none;
    font-size: 0.875rem;
}

.folder-browser-nav .breadcrumb-link:hover {
    text-decoration: underline;
}

.folder-browser-nav .breadcrumb-separator {
    margin: 0 0.25rem;
    color: #6c757d;
}

.folder-browser-nav .breadcrumb-current {
    font-weight: 500;
    color: #212529;
    font-size: 0.875rem;
}

.folder-browser-tree {
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
}

.folder-browser-tree .file-tree {
    min-height: 200px;
}

.folder-browser-tree .tree-item {
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.folder-browser-tree .tree-item:hover {
    background: #e9ecef;
}

.folder-browser-tree .tree-item.selected {
    background: #cfe2ff;
    border: 1px solid #b6d4fe;
}

.folder-browser-tree .tree-item.compact {
    padding: 0.375rem 0.75rem;
}

.folder-browser-tree .tree-item-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.folder-browser-tree .tree-item-name {
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-browser-tree .tree-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    color: #6c757d;
}

.folder-browser-tree .empty-state-small {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.folder-browser-help {
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    font-size: 0.8rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================================================
   Agent Configuration (Step 5)
   ============================================================================ */

.default-agents-display {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
}

.agent-default-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.agent-default-item i {
    font-size: 1rem;
}

.specialist-agents-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.specialist-agents-list .card {
    border: 1px solid #dee2e6;
    transition: box-shadow 0.2s;
}

.specialist-agents-list .card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ============================================================================
   Project Details Display (Step 3)
   ============================================================================ */

.project-details {
    margin-top: 1rem;
}

.project-details h6 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
}

.subproject-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.subproject-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    transition: background 0.2s;
}

.subproject-item:hover {
    background: rgba(255, 255, 255, 0.15);
}

.subproject-path {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.95);
    background: rgba(0, 0, 0, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    flex: 1;
    margin-right: 0.5rem;
}

.subproject-type {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border: none;
    text-transform: uppercase;
}

.entry-points-list,
.plans-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.entry-points-list li,
.plans-list li {
    padding: 0.375rem 0;
    color: rgba(255, 255, 255, 0.9);
}

.entry-points-list code,
.plans-list code {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.95);
}

.project-stat-value small {
    font-size: 0.75rem;
    font-weight: normal;
    opacity: 0.8;
    display: block;
    margin-top: 0.25rem;
}

/* ============================================================================
   Step 6 Review - Redesigned
   ============================================================================ */

/* Review Section Layout */
.review-section {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.review-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
}

.review-section-header i {
    color: #198754;
}

.review-section-body {
    padding: 1rem;
}

/* Goal Display with Markdown */
.goal-display {
    line-height: 1.6;
    color: #212529;
}

.goal-display h1,
.goal-display h2,
.goal-display h3 {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.goal-display p {
    margin-bottom: 0.75rem;
}

.goal-display ul,
.goal-display ol {
    margin-left: 1.5rem;
    margin-bottom: 0.75rem;
}

.goal-display code {
    background: #f8f9fa;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.875em;
}

/* Config Display & Edit */
.config-display {
    color: #495057;
    line-height: 1.6;
}

.config-display strong {
    color: #212529;
    font-weight: 600;
}

.config-edit-form {
    padding: 0.5rem 0;
}

/* Agent Configuration Details */
.agent-details {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.specialist-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.875rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Edit Goal Modal */
.modal-backdrop-custom {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-dialog-custom {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1051;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.modal-dialog-custom .modal-content {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.modal-dialog-custom .modal-body {
    overflow-y: auto;
}

.goal-preview {
    min-height: 100px;
    max-height: 300px;
    overflow-y: auto;
    line-height: 1.6;
}

.goal-preview p:last-child {
    margin-bottom: 0;
}

/* Wizard Navigation with Multiple Buttons */
.wizard-nav > div {
    display: flex;
    gap: 0.75rem;
}

/* Responsive adjustments for Step 6 */
@media (max-width: 768px) {
    .review-section-body {
        padding: 0.75rem;
    }
    
    .config-edit-form .row {
        gap: 0.75rem;
    }
    
    .config-edit-form .col-md-4 {
        width: 100%;
    }
    
    .modal-dialog-custom {
        width: 95%;
        max-height: 95vh;
    }
    
    .wizard-nav > div {
        flex-direction: column;
        width: 100%;
    }
    
    .wizard-nav > div button {
        width: 100%;
    }
}
