/**
 * AI Evaluation Modal Styles
 *
 * Styles the quality evaluation modal for workflow stage transitions.
 * Works with the existing ai-evaluate.js module.
 */

/* =========================================================================
 * EVALUATION MODAL SPECIFIC STYLES
 * Builds on .ai-modal base styles in screenplay.css
 * ========================================================================= */

.ai-evaluation-modal {
    max-width: 560px;
    width: 95%;
}

/* Loading state */
.evaluation-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.evaluation-loading .loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #00D9FF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

.evaluation-loading p {
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
}

/* =========================================================================
 * OVERALL SCORE SECTION
 * ========================================================================= */

.evaluation-overall {
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.evaluation-overall.passed {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.15) 0%, rgba(0, 217, 255, 0.1) 100%);
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.evaluation-overall.blocked {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.15) 0%, rgba(255, 159, 67, 0.1) 100%);
    border: 1px solid rgba(255, 107, 107, 0.3);
}

.overall-score {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    margin-bottom: 12px;
}

.score-value {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1;
}

.evaluation-overall.passed .score-value {
    color: #00FF88;
}

.evaluation-overall.blocked .score-value {
    color: #FF6B6B;
}

.score-max {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
}

/* Score progress bar */
.overall-bar {
    width: 100%;
    max-width: 280px;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin: 0 auto 16px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.evaluation-overall.passed .bar-fill {
    background: linear-gradient(90deg, #00FF88, #00D9FF);
}

.evaluation-overall.blocked .bar-fill {
    background: linear-gradient(90deg, #FF6B6B, #FF9F43);
}

/* Status indicator */
.overall-status {
    margin-top: 8px;
}

.status-passed,
.status-blocked {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.status-passed {
    background: rgba(0, 255, 136, 0.2);
    color: #00FF88;
}

.status-blocked {
    background: rgba(255, 107, 107, 0.2);
    color: #FF6B6B;
}

.status-passed .material-icons-outlined,
.status-blocked .material-icons-outlined {
    font-size: 18px;
}

/* =========================================================================
 * SUMMARY SECTION
 * ========================================================================= */

.evaluation-summary {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 3px solid rgba(0, 217, 255, 0.5);
}

.evaluation-summary p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    font-style: italic;
}

/* =========================================================================
 * CRITERIA LIST
 * ========================================================================= */

.evaluation-criteria {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.criterion {
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.criterion:hover {
    background: rgba(255, 255, 255, 0.04);
}

.criterion-passed {
    border-left: 3px solid #00FF88;
}

.criterion-failed {
    border-left: 3px solid #FF6B6B;
}

.criterion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.criterion-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
}

.criterion-score {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Star rating */
.star-rating {
    display: inline-flex;
    gap: 2px;
}

.star {
    font-size: 16px;
    line-height: 1;
}

.star.filled {
    color: #FFD700;
}

.star.empty {
    color: rgba(255, 255, 255, 0.2);
}

/* Needs work badge */
.needs-work {
    display: inline-block;
    padding: 2px 8px;
    background: rgba(255, 107, 107, 0.2);
    color: #FF6B6B;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
}

/* Criterion feedback */
.criterion-feedback {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.6);
}

/* =========================================================================
 * BLOCKING REASONS
 * ========================================================================= */

.evaluation-blocking {
    padding: 16px 20px;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 8px;
    margin-bottom: 20px;
}

.evaluation-blocking h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #FF6B6B;
}

.evaluation-blocking h4 .material-icons-outlined {
    font-size: 20px;
}

.evaluation-blocking ul {
    margin: 0;
    padding: 0 0 0 20px;
    list-style: disc;
}

.evaluation-blocking li {
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.5;
}

.evaluation-blocking li:last-child {
    margin-bottom: 0;
}

/* =========================================================================
 * SUGGESTIONS
 * ========================================================================= */

.evaluation-suggestions {
    padding: 16px 20px;
    background: rgba(0, 217, 255, 0.05);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 8px;
    margin-bottom: 20px;
}

.evaluation-suggestions h4 {
    margin: 0 0 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #00D9FF;
}

.evaluation-suggestions ul {
    margin: 0;
    padding: 0 0 0 20px;
    list-style: disc;
}

.evaluation-suggestions li {
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.5;
}

.evaluation-suggestions li:last-child {
    margin-bottom: 0;
}

/* =========================================================================
 * ACTIONS
 * ========================================================================= */

.evaluation-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 8px;
}

.evaluation-actions .ai-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.evaluation-actions .ai-btn:not(.ai-btn-primary) {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.evaluation-actions .ai-btn:not(.ai-btn-primary):hover {
    background: rgba(255, 255, 255, 0.15);
}

.evaluation-actions .ai-btn-primary {
    background: linear-gradient(135deg, #00D9FF 0%, #00FF88 100%);
    color: #1a1a2e;
}

.evaluation-actions .ai-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 217, 255, 0.3);
}

.evaluation-actions .ai-btn .material-icons-outlined {
    font-size: 18px;
}

/* =========================================================================
 * PROVIDER INFO
 * ========================================================================= */

.evaluation-provider {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
}

/* =========================================================================
 * ERROR STATE
 * ========================================================================= */

.evaluation-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px;
    text-align: center;
}

.evaluation-error .material-icons-outlined {
    font-size: 48px;
    color: #FF6B6B;
    margin-bottom: 16px;
}

.evaluation-error p {
    margin: 0 0 20px;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
}

.evaluation-error .ai-btn {
    padding: 10px 24px;
}

/* =========================================================================
 * SUBSTAGE PROGRESS BAR
 * ========================================================================= */

#substage-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 16px;
}

.substage-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.2s;
}

.substage-item.completed {
    color: #00FF88;
}

.substage-item.current {
    background: rgba(0, 217, 255, 0.15);
    color: #00D9FF;
    font-weight: 600;
}

.substage-item.upcoming {
    color: rgba(255, 255, 255, 0.3);
}

.substage-connector {
    width: 24px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
}

.substage-connector.completed {
    background: #00FF88;
}

/* =========================================================================
 * RESPONSIVE
 * ========================================================================= */

@media (max-width: 560px) {
    .ai-evaluation-modal {
        max-height: 90vh;
        overflow-y: auto;
    }

    .evaluation-overall {
        padding: 20px 16px;
    }

    .score-value {
        font-size: 2.5rem;
    }

    .criterion-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .evaluation-actions {
        flex-direction: column;
    }

    .evaluation-actions .ai-btn {
        width: 100%;
        justify-content: center;
    }
}
