/**
 * Evaluators Page CSS - View and test LLM judge prompts
 */

/* ============================================
   EVALUATOR TABS
   ============================================ */
.evaluators-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
}

.eval-tab {
    padding: 10px 20px;
    border: none;
    background: var(--bg-warm);
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.eval-tab.active {
    background: var(--accent);
    color: white;
}

.eval-tab:hover:not(.active) {
    background: var(--bg-cream);
}

.eval-content {
    display: none;
}

.eval-content.active {
    display: block;
}

/* ============================================
   EVALUATOR LAYOUT
   ============================================ */
.evaluator-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
}

.evaluator-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.evaluator-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ============================================
   EVALUATOR CARDS
   ============================================ */
.eval-card {
    background: var(--bg-card);
    border-radius: 14px;
    overflow: hidden;
}

.eval-card-header {
    padding: 16px 20px;
    background: var(--bg-cream);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.eval-card-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.eval-card-badge {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    font-family: 'DM Mono', monospace;
    background: var(--accent-light);
    color: var(--accent);
}

.eval-card-body {
    padding: 20px;
}

/* ============================================
   PROMPT DISPLAY
   ============================================ */
.prompt-section {
    margin-bottom: 20px;
}

.prompt-section:last-child {
    margin-bottom: 0;
}

.prompt-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-family: 'DM Mono', monospace;
    margin-bottom: 10px;
}

.prompt-box {
    background: var(--bg-cream);
    border-radius: 10px;
    padding: 16px;
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    line-height: 1.6;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text);
}

.prompt-box.collapsed {
    max-height: 150px;
}

.prompt-toggle {
    margin-top: 10px;
    padding: 8px 16px;
    border: none;
    background: var(--bg-warm);
    border-radius: 6px;
    font-family: inherit;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.prompt-toggle:hover {
    background: var(--bg-cream);
    color: var(--text);
}

/* ============================================
   SCENARIOS LIST
   ============================================ */
.scenarios-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.scenario-item {
    background: var(--bg-cream);
    border-radius: 10px;
    overflow: hidden;
}

.scenario-header {
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.15s;
}

.scenario-header:hover {
    background: var(--bg-warm);
}

.scenario-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.scenario-severity {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    font-family: 'DM Mono', monospace;
    text-transform: uppercase;
    font-weight: 500;
}

.scenario-severity.critical {
    background: var(--accent-light);
    color: var(--accent);
}

.scenario-severity.high {
    background: var(--gold-light);
    color: var(--gold);
}

.scenario-severity.moderate {
    background: var(--sage-light);
    color: var(--sage);
}

.scenario-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}

.scenario-dimension {
    font-size: 11px;
    color: var(--text-muted);
    font-family: 'DM Mono', monospace;
}

.scenario-toggle {
    transition: transform 0.2s;
    color: var(--text-muted);
}

.scenario-toggle.rotated {
    transform: rotate(90deg);
}

.scenario-detail {
    display: none;
    padding: 0 16px 16px;
    border-top: 1px solid var(--border);
}

.scenario-detail.open {
    display: block;
}

.scenario-example {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
    font-size: 12px;
    font-style: italic;
    color: var(--text-muted);
    line-height: 1.5;
}

.behavior-section {
    margin-top: 12px;
}

.behavior-title {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.behavior-title.positive {
    color: var(--sage);
}

.behavior-title.negative {
    color: var(--accent);
}

.behavior-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.behavior-list li {
    font-size: 12px;
    padding: 6px 0;
    padding-left: 16px;
    position: relative;
    color: var(--text);
    line-height: 1.4;
}

.behavior-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.behavior-list.positive li::before {
    background: var(--sage);
}

.behavior-list.negative li::before {
    background: var(--accent);
}

/* ============================================
   HARD RULES DISPLAY
   ============================================ */
.hard-rules-section {
    margin-top: 16px;
}

.rule-category {
    margin-bottom: 16px;
}

.rule-category-title {
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 10px;
    color: var(--text);
}

.rule-patterns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rule-pattern {
    font-size: 11px;
    padding: 4px 10px;
    background: var(--bg-warm);
    border-radius: 6px;
    font-family: 'DM Mono', monospace;
    color: var(--text-muted);
}

/* ============================================
   TEST PANEL
   ============================================ */
.test-panel {
    background: var(--bg-card);
    border-radius: 14px;
    overflow: hidden;
}

.test-panel-header {
    padding: 16px 20px;
    background: var(--sage-light);
    border-bottom: 1px solid var(--border);
}

.test-panel-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--sage);
}

.test-panel-body {
    padding: 20px;
}

.test-input-group {
    margin-bottom: 16px;
}

.test-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-family: 'DM Mono', monospace;
    margin-bottom: 8px;
    display: block;
}

.test-textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    resize: vertical;
    line-height: 1.5;
}

.test-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.test-actions {
    margin-top: 16px;
}

.test-btn {
    width: 100%;
    padding: 12px 20px;
    border: none;
    background: var(--sage);
    color: white;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.test-btn:hover:not(:disabled) {
    background: var(--sage-dark, #5a7a5d);
    transform: translateY(-1px);
}

.test-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.test-btn.loading {
    position: relative;
    color: transparent;
}

.test-btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid white;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   TEST RESULTS
   ============================================ */
.test-results {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.test-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.test-result-title {
    font-size: 13px;
    font-weight: 500;
}

.test-result-score {
    font-size: 18px;
    font-weight: 600;
    font-family: 'DM Mono', monospace;
}

.test-result-score.pass {
    color: var(--sage);
}

.test-result-score.warning {
    color: var(--gold);
}

.test-result-score.fail {
    color: var(--accent);
}

.test-result-details {
    background: var(--bg-cream);
    border-radius: 10px;
    padding: 16px;
    font-size: 12px;
}

.test-result-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.test-result-row:last-child {
    border-bottom: none;
}

.test-result-label {
    color: var(--text-muted);
}

.test-result-value {
    font-family: 'DM Mono', monospace;
    color: var(--text);
}

.test-result-insights {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.test-result-insights-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-family: 'DM Mono', monospace;
    margin-bottom: 8px;
}

.test-result-insight {
    font-size: 12px;
    padding: 6px 0;
    padding-left: 16px;
    position: relative;
    color: var(--text);
    line-height: 1.4;
}

.test-result-insight::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

/* ============================================
   SCORING GUIDANCE
   ============================================ */
.scoring-guidance {
    margin-top: 16px;
}

.scoring-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.scoring-item:last-child {
    border-bottom: none;
}

.scoring-range {
    font-size: 12px;
    font-family: 'DM Mono', monospace;
    font-weight: 500;
    min-width: 60px;
    color: var(--text);
}

.scoring-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ============================================
   COPY BUTTON
   ============================================ */
.copy-btn {
    padding: 6px 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: 6px;
    font-family: inherit;
    font-size: 11px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.copy-btn.copied {
    background: var(--sage-light);
    border-color: var(--sage);
    color: var(--sage);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1100px) {
    .evaluator-grid {
        grid-template-columns: 1fr;
    }

    .evaluator-sidebar {
        order: -1;
    }
}
