/* Font imports */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --pivotal-blue: #3A82B5;
    --pivotal-blue-light: #EBF2F7;
    --pivotal-orange: #F15F22;
    --pivotal-orange-light: #FDE7E0;
    --pivotal-gray: #6C757D;
    --pivotal-light-gray: #E9ECEF;
    --pivotal-night: #343A40;
    --honest-green: rgb(34, 139, 34);
    --deceptive-red: rgb(220, 20, 20);
}

/* Base styles */
body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f0f0f0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Navigation bar */
.navigation-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.dataset-selector {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: nowrap;
}

/* Controls and inputs */
select, button {
    font-family: 'Poppins', sans-serif;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid var(--pivotal-light-gray);
}

select {
    background-color: white;
    min-width: 120px;
}

button {
    cursor: pointer;
    background-color: var(--pivotal-blue-light);
    color: var(--pivotal-blue);
    border: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

button:hover {
    background-color: var(--pivotal-blue);
    color: white;
}

/* Navigation controls */
.nav-button {
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sample-counter {
    font-size: 1.1em;
    color: var(--pivotal-night);
    font-weight: 500;
}

/* Game bar */
.game-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px;
    background-color: var(--pivotal-light-gray);
    border-radius: 4px;
    margin-bottom: 20px;
}

.game-controls {
    display: flex;
    gap: 10px;
}

#guess-honest-button {
    background-color: var(--honest-green);
    color: white;
}

#guess-deceptive-button {
    background-color: var(--deceptive-red);
    color: white;
}

.game-score {
    font-weight: 500;
    color: var(--pivotal-night);
}

/* View controls */
.view-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Token display */
.token-display {
    background-color: white;
    border-radius: 8px;
    border: 1px solid var(--pivotal-light-gray);
    padding: 15px;
    margin: 15px 0;
    font-family: monospace;
    line-height: 1.5;
    tab-size: 4;
    display: block;
    min-height: 50px;
    max-height: 300px;
    overflow: auto;
}

/* Analysis sections */
.analysis-section {
    margin-top: 20px;
}

.analysis-subsection {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--pivotal-light-gray);
}

.analysis-subsection h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--pivotal-blue);
    font-size: 1.1em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid var(--pivotal-light-gray);
}

.stat-item {
    background-color: white;
    padding: 15px;
    border-radius: 4px;
}

.stat-label {
    color: var(--pivotal-gray);
    font-size: 0.9em;
    margin-bottom: 5px;
}

.stat-value, .reasoning-score {
    font-size: 1.2em;
    font-weight: 500;
    color: black !important;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Token counts always white background */
#assistant-token-count,
#critical-token-count {
    background-color: white;
}

/* Histogram */
.histogram-container {
    height: 200px;
    display: flex;
    align-items: flex-end;
    padding: 10px;
    border: 1px solid var(--pivotal-light-gray);
    border-radius: 4px;
    margin: 15px 0;
    background-color: white;
    position: relative;
}

.histogram-bar {
    flex: 1;
    margin: 0 1px;
    transition: height 0.3s ease;
    position: relative;
}

.histogram-bar:hover::after {
    content: attr(data-count) ' tokens (' attr(data-score-range) ')';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--pivotal-night);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10;
}

.avg-score-indicator {
    position: absolute;
    height: 100%;
    width: 2px;
    background-color: var(--pivotal-gray);
    z-index: 5;
}

/* Follow-ups section */
.follow-up-item {
    margin: 10px 0;
    border: 1px solid var(--pivotal-light-gray);
    border-radius: 4px;
    overflow: hidden;
    background-color: white;
}

.follow-up-header {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background-color: white;
    cursor: pointer;
    user-select: none;
}

.follow-up-header:hover {
    background-color: var(--pivotal-blue-light);
}

/* Active states */
button.active {
    background-color: var(--pivotal-blue);
    color: white;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

/* Feedback text */
.feedback-text {
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: 500;
    margin-left: auto;
}

.feedback-text.honest {
    color: var(--honest-green);
}

.feedback-text.deceptive {
    color: var(--deceptive-red);
}

/* Utility classes */
.hidden {
    display: none;
}

.error {
    color: var(--deceptive-red);
    padding: 10px;
    border: 1px solid var(--deceptive-red);
    border-radius: 4px;
    margin: 10px 0;
}

/* Critical token styles */
.model-note {
    font-size: 0.8em;
    color: var(--pivotal-gray);
    font-weight: normal;
    font-style: italic;
}

.critical-badge {
    margin-left: 8px;
    padding: 2px 6px;
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    border-radius: 4px;
    font-size: 12px;
    color: #856404;
}

/* Reasoning section styles */
.reasoning-block {
    margin-top: 15px;
    padding: 15px;
    border: 1px solid var(--pivotal-light-gray);
    border-radius: 4px;
    background-color: white;
}

.reasoning-block h4 {
    color: var(--pivotal-blue);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1em;
    font-weight: 500;
}

.reasoning-item {
    margin-bottom: 12px;
    padding: 10px;
    background-color: white;
    border-radius: 4px;
    border: 1px solid var(--pivotal-light-gray);
}

.reasoning-label {
    color: var(--pivotal-gray);
    font-size: 0.9em;
    margin-bottom: 5px;
}

.reasoning-text {
    color: var(--pivotal-gray);
    font-size: 0.9em;
    line-height: 1.4;
    margin-top: 5px;
}

.model-note {
    font-size: 0.8em;
    color: var(--pivotal-gray);
    font-weight: normal;
    font-style: italic;
    margin-top: 5px;
    margin-bottom: 15px;
}

.monitor-empty {
    padding: 15px;
    text-align: center;
    color: var(--pivotal-gray);
    font-style: italic;
    background-color: var(--pivotal-light-gray);
    border-radius: 4px;
    margin: 10px 0;
}