/* Analyst Page */
.analyst-page {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.analyst-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.analyst-header h1 {
    font-size: 1.5rem;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-lg);
    padding: 4rem 2rem;
    text-align: center;
    transition: all var(--transition);
    cursor: pointer;
    background: var(--surface);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-muted);
}

.upload-zone .upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.upload-zone h3 {
    margin-bottom: 0.5rem;
}

.upload-zone p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.upload-zone .upload-hint {
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.upload-zone input[type="file"] {
    display: none;
}

.upload-zone .btn {
    pointer-events: none;
}

/* Generating State */
.generating-state {
    text-align: center;
    padding: 4rem 2rem;
}

.generating-state .spinner {
    width: 40px;
    height: 40px;
    margin-bottom: 1rem;
}

.generating-state h3 {
    margin-bottom: 0.5rem;
}

.generating-state p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Rubric Scorecard */
.rubric-scorecard {
    background: var(--surface-raised);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem 2.5rem;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.rubric-scorecard .rubric-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1.25rem;
}

.rubric-scorecard .rubric-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.rubric-scorecard .rubric-verdict {
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
}

.rubric-verdict.recommend { background: #16a34a22; color: #16a34a; }
.rubric-verdict.consider { background: #ca8a0422; color: #ca8a04; }
.rubric-verdict.pass { background: #64748b22; color: #64748b; }

.rubric-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.rubric-metric {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--border);
}

.rubric-metric .metric-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.rubric-metric .metric-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.rubric-metric .metric-rank {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.1rem 0.5rem;
    border-radius: var(--radius-sm);
}

.metric-rank.excellent { background: #16a34a22; color: #16a34a; }
.metric-rank.good { background: #2563eb22; color: #2563eb; }
.metric-rank.fair { background: #ca8a0422; color: #ca8a04; }
.metric-rank.poor { background: #dc262622; color: #dc2626; }

.rubric-metric .metric-justification {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

@media (max-width: 768px) {
    .rubric-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Coverage Document */
.coverage-document {
    background: var(--surface-raised);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    border: 1px solid var(--border);
    margin-bottom: 2rem;
}

.coverage-document .coverage-title {
    font-size: 1.75rem;
    text-align: center;
    color: var(--white);
    margin-bottom: 0.25rem;
}

.coverage-document .coverage-logline {
    text-align: center;
    font-style: italic;
    color: var(--text-light);
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.coverage-document .coverage-genre {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.coverage-section {
    margin-bottom: 1.75rem;
}

.coverage-section h2 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 0.6rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--border-light);
}

.coverage-section p {
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.7;
    margin-bottom: 0.5rem;
}

/* Recommendation badge */
.coverage-recommendation {
    display: inline-block;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.coverage-recommendation.recommend {
    background: rgba(74,222,128,0.15);
    color: #4ade80;
    border: 1px solid rgba(74,222,128,0.3);
}

.coverage-recommendation.consider {
    background: rgba(59,130,246,0.15);
    color: #60a5fa;
    border: 1px solid rgba(59,130,246,0.3);
}

.coverage-recommendation.pass {
    background: rgba(239,68,68,0.15);
    color: #ef4444;
    border: 1px solid rgba(239,68,68,0.3);
}

/* Download Button */
.coverage-download {
    text-align: center;
    margin-bottom: 2rem;
}

/* Analyst Chat */
.analyst-chat {
    background: var(--surface-raised);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.analyst-chat-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.analyst-chat-header h3 {
    font-size: 1rem;
    color: var(--text);
}

.analyst-messages {
    max-height: 400px;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.analyst-messages .message {
    max-width: 80%;
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-lg);
    line-height: 1.65;
    font-size: 0.93rem;
    animation: fadeIn 0.3s ease;
}

.analyst-messages .message.user {
    background: var(--accent);
    color: #000;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.analyst-messages .message.assistant {
    background: var(--surface);
    color: var(--text);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border);
}

.analyst-messages .message.assistant strong {
    color: var(--white);
}

.analyst-messages .message.streaming::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 16px;
    background: var(--accent);
    margin-left: 2px;
    animation: blink 0.8s infinite;
    vertical-align: text-bottom;
}

.analyst-chat-input {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.analyst-chat-input textarea {
    flex: 1;
    padding: 0.65rem 0.9rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.93rem;
    resize: none;
    min-height: 40px;
    max-height: 120px;
    line-height: 1.5;
    color: var(--text);
    background: var(--surface);
    transition: border-color var(--transition);
}

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

.analyst-chat-input .send-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--accent);
    color: #000;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
    flex-shrink: 0;
}

.analyst-chat-input .send-btn:hover {
    background: #86efac;
}

.analyst-chat-input .send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.analyst-chat-input .send-btn svg {
    width: 18px;
    height: 18px;
}

/* Empty chat state */
.analyst-chat-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Multi-pass analysis steps */
.analysis-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 400px;
    margin: 2rem auto 0;
    text-align: left;
}

.analysis-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    opacity: 0.4;
    transition: all 0.3s ease;
}

.analysis-step.active {
    opacity: 1;
    border-color: var(--accent-border);
    background: var(--accent-muted);
}

.analysis-step.done {
    opacity: 0.7;
    border-color: var(--border);
}

.step-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--surface-raised);
    border: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    flex-shrink: 0;
}

.analysis-step.active .step-indicator {
    border-color: var(--accent);
    color: var(--accent);
    animation: pulse-green 1.5s ease-in-out infinite;
}

.analysis-step.done .step-indicator {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
}

.step-label {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text);
}

.step-detail {
    display: none;
}

.analysis-step.active .step-detail {
    display: block;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-left: auto;
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0.4); }
    50% { box-shadow: 0 0 0 6px rgba(74,222,128,0); }
}

/* Responsive */
@media (max-width: 768px) {
    .analyst-page {
        padding: 0 1rem;
    }

    .coverage-document {
        padding: 1.5rem;
    }

    .analyst-messages .message {
        max-width: 90%;
    }
}

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

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}
