/* Watchdog Public App Styles */

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #f5f7fa;
    --surface: #ffffff;
    --text: #1a1a2e;
    --text-muted: #6b7280;
    --border: #e2e8f0;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --score-high: #10b981;
    --score-mid: #f59e0b;
    --score-low: #ef4444;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* ===== Navbar ===== */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    height: 60px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.nav-brand {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}
.nav-brand:hover {
    text-decoration: none;
}

.nav-tagline {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    border-left: 1px solid var(--border);
    padding-left: 1rem;
    text-decoration: none;
}
.nav-tagline:hover {
    color: var(--primary);
    text-decoration: none;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    transition: color 0.15s;
}
.nav-link:first-of-type {
    margin-left: auto;
}
.nav-link + .nav-link {
    margin-left: 1.25rem;
}
.nav-link:hover {
    color: var(--primary);
    text-decoration: none;
}

/* ===== Container ===== */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 120px);
}

/* ===== Hero ===== */
.hero {
    text-align: center;
    padding: 2.5rem 0 1.5rem;
}
.hero h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 0.75rem;
}
.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ===== Page Header ===== */
.page-header {
    margin-bottom: 2rem;
}
.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.subtitle {
    color: var(--text-muted);
    margin-top: 0.25rem;
    font-size: 0.9rem;
}

/* ===== Cards ===== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}
.card h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
}

/* ===== Prompt Card ===== */
.prompt-card {
    max-width: 700px;
    margin: 0 auto 2rem;
}

.prompt-card textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.15s;
    min-height: 100px;
}
.prompt-card textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.prompt-card textarea::placeholder {
    color: #9ca3af;
}

.char-count {
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ===== Forms ===== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
}

/* ===== Model Grid ===== */
.model-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.5rem;
}
.model-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.85rem;
}
.model-option:hover {
    border-color: var(--primary);
    background: #f5f3ff;
}
.model-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}
.model-option input[type="checkbox"]:disabled + .model-label {
    opacity: 0.4;
}
.model-label {
    font-weight: 500;
}

/* ===== Buttons ===== */
.btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}
.btn:hover {
    text-decoration: none;
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.btn-large {
    padding: 0.85rem 2.5rem;
    font-size: 1rem;
    width: 100%;
}

/* ===== Tags ===== */
.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #eef2ff;
    color: var(--primary);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
}
.tag-model {
    background: #eef2ff;
    color: var(--primary);
}

/* ===== Progress Bar ===== */
.progress-bar-container {
    width: 100%;
    height: 12px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 999px;
    transition: width 0.3s ease;
}
.progress-text {
    color: var(--text-muted);
    font-size: 0.85rem;
}
.error-text {
    color: var(--danger);
    margin-bottom: 1rem;
}

/* ===== Score Badges ===== */
.score-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 0.85rem;
}
.score-badge-lg {
    padding: 0.4rem 0.85rem;
    font-size: 1.25rem;
}
.score-badge-lg .score-max {
    font-size: 0.7em;
    opacity: 0.6;
    font-weight: 500;
}
.score-high {
    background: #d1fae5;
    color: #065f46;
}
.score-mid {
    background: #fef3c7;
    color: #92400e;
}
.score-low {
    background: #fee2e2;
    color: #991b1b;
}

/* ===== Criteria Grid ===== */
.criteria-grid {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin: 0.75rem 0;
}
.criteria-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border-radius: var(--radius);
}
.criteria-name {
    text-transform: capitalize;
    font-size: 0.82rem;
    font-weight: 500;
}

/* ===== Flags ===== */
.flags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
    margin: 0.5rem 0;
}
.flag-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.flag-none { background: #e2e8f0; color: #64748b; }
.flag-refusal_to_engage { background: #fde8e8; color: #991b1b; }
.flag-factual_error { background: #fde8e8; color: #991b1b; }
.flag-asymmetric_hedging { background: #fef3c7; color: #92400e; }
.flag-sycophantic_agreement { background: #fef3c7; color: #92400e; }
.flag-selective_evidence { background: #ffe4e6; color: #9f1239; }
.flag-false_equivalence { background: #e0e7ff; color: #3730a3; }

/* ===== Prompt Display ===== */
.prompt-display {
    background: #f8fafc;
    padding: 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 1rem;
    line-height: 1.7;
    white-space: pre-wrap;
}

/* ===== Response Cards Grid ===== */
.responses-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.responses-grid-1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 700px;
    margin: 0 auto;
}

.response-card {
    margin-bottom: 0;
}
.response-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.response-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.response-body {
    font-size: 0.88rem;
    line-height: 1.7;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 1rem;
    background: #fafbfc;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.response-error {
    color: var(--danger);
    font-style: italic;
}

/* ===== Grade Section ===== */
.grade-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.grade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.grade-header h4 {
    font-size: 0.95rem;
    font-weight: 600;
}

.rationale-details {
    margin-top: 0.75rem;
}
.rationale-details summary {
    font-size: 0.82rem;
    color: var(--primary);
    cursor: pointer;
    font-weight: 500;
}
.rationale-details summary:hover {
    text-decoration: underline;
}
.rationale-text {
    margin-top: 0.5rem;
    background: #f8fafc;
    padding: 0.75rem;
    border-radius: var(--radius);
    font-size: 0.82rem;
    border: 1px solid var(--border);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 300px;
    overflow-y: auto;
    font-family: inherit;
}

/* ===== Feedback Section ===== */
.feedback-inline {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.feedback-model-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    background: #fafbfc;
}
.feedback-model-card h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.feedback-row {
    margin-bottom: 1rem;
}
.feedback-label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
}

/* Star Rating */
.star-rating {
    display: inline-flex;
    flex-direction: row-reverse;
    gap: 0.15rem;
}
.star-rating input {
    display: none;
}
.star-rating label {
    cursor: pointer;
    font-size: 1.75rem;
    color: #d1d5db;
    transition: color 0.1s;
    line-height: 1;
}
.star-rating label:hover,
.star-rating label:hover ~ label,
.star-rating input:checked ~ label {
    color: #f59e0b;
}

/* Agreement Radio Group */
.agreement-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.agreement-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s;
}
.agreement-option:hover {
    border-color: var(--primary);
    background: #f5f3ff;
}
.agreement-option input[type="radio"] {
    accent-color: var(--primary);
}

/* Feedback Comment */
.feedback-comment {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.15s;
}
.feedback-comment:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* ===== Info Section ===== */
.info-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    max-width: 700px;
    margin: 0 auto 2rem;
}
.info-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
}
.info-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text);
}
.info-card ol, .info-card ul {
    padding-left: 1.25rem;
    font-size: 0.85rem;
    line-height: 1.8;
    color: var(--text-muted);
}
.info-card strong {
    color: var(--text);
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 1.5rem 2rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
}

/* ===== Utility ===== */
.hidden {
    display: none !important;
}
.muted {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== Criteria Page ===== */
.criteria-page {
    max-width: 780px;
    margin: 0 auto;
    padding-bottom: 2rem;
}

.criteria-header {
    margin-bottom: 2rem;
}
.criteria-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 0.5rem;
}
.criteria-header h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}
.criteria-lead {
    font-size: 1.02rem;
    color: var(--text-muted);
    line-height: 1.75;
}

.criteria-intro {
    margin-bottom: 2rem;
}
.criteria-intro p {
    font-size: 0.92rem;
    color: #444;
    line-height: 1.75;
    margin-bottom: 1rem;
}

/* Criterion Cards */
.criterion-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}
.criterion-num {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 0.2rem;
}
.criterion-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}
.criterion-desc {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* Score Anchors */
.anchor-row {
    display: flex;
    gap: 0;
    border-radius: var(--radius);
    overflow: hidden;
    font-size: 0.82rem;
    line-height: 1.55;
}
.anchor {
    flex: 1;
    padding: 0.65rem 0.9rem;
}
.anchor-low {
    background: #fee2e2;
    color: #991b1b;
}
.anchor-high {
    background: #d1fae5;
    color: #065f46;
    text-align: right;
}
.anchor-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 0.15rem;
}

/* Section Headings */
.section-heading {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 2.5rem 0 0.75rem;
    letter-spacing: -0.02em;
}
.section-text {
    font-size: 0.92rem;
    color: #444;
    line-height: 1.75;
    margin-bottom: 1.25rem;
}

/* Scoring Band */
.scoring-band {
    display: flex;
    border-radius: var(--radius);
    overflow: hidden;
    font-size: 0.82rem;
    text-align: center;
    margin: 1.25rem 0;
}
.band-segment {
    padding: 0.75rem 0.5rem;
    color: white;
    font-weight: 500;
}
.band-range {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    margin-bottom: 0.1rem;
}
.band-label {
    font-size: 0.7rem;
    opacity: 0.88;
}
.band-high     { background: #10b981; flex: 5; }
.band-good     { background: #3b82f6; flex: 5; }
.band-moderate { background: #ea580c; flex: 6; }
.band-strong   { background: #dc2626; flex: 5; }

/* Divider */
.criteria-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2.5rem 0;
}

/* Flags Grid (criteria page variant) */
.flag-grid-criteria {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
    margin: 1rem 0;
}
.flag-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.75rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.82rem;
}
.flag-code-label {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
    padding-top: 0.1rem;
    flex-shrink: 0;
}
.flag-desc {
    color: var(--text-muted);
    line-height: 1.5;
}

/* Callout */
.criteria-callout {
    background: #fef3c7;
    border-left: 3px solid #ea580c;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    font-size: 0.88rem;
    line-height: 1.7;
    border-radius: 0 var(--radius) var(--radius) 0;
    color: #444;
}
.criteria-callout strong {
    color: var(--text);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    .navbar {
        padding: 0 1rem;
    }
    .hero h1 {
        font-size: 1.5rem;
    }
    .hero-subtitle {
        font-size: 0.9rem;
    }
    .responses-grid-2 {
        grid-template-columns: 1fr;
    }
    .info-section {
        grid-template-columns: 1fr;
    }
    .agreement-group {
        flex-direction: column;
    }
    .model-grid {
        grid-template-columns: 1fr;
    }
    .flag-grid-criteria {
        grid-template-columns: 1fr;
    }
    .anchor-row {
        flex-direction: column;
    }
    .anchor-high {
        text-align: left;
    }
    .criteria-header h1 {
        font-size: 1.5rem;
    }
}
