/**
 * Bias Explorer - Main Stylesheet (Enhanced)
 * Version: 1.1.0
 * Colors: Deep Teal, Warm Apricot, Soft Coral
 */

/* Import Inter font for better typography */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* CSS Variables for Brand Colors */
:root {
    --be-primary: #2A6F97;
    --be-primary-dark: #1e4f6b;
    --be-primary-light: #3d89b5;
    --be-secondary: #F4A261;
    --be-secondary-dark: #e08941;
    --be-secondary-light: #f6b481;
    --be-accent: #E76F51;
    --be-accent-dark: #d54e2e;
    --be-accent-light: #ed8971;
    --be-background: #F9FAFB;
    --be-text-primary: #1F2937;
    --be-text-secondary: #4B5563;
    --be-white: #FFFFFF;
    --be-gray-100: #F3F4F6;
    --be-gray-200: #E5E7EB;
    --be-gray-300: #D1D5DB;
    --be-success: #10B981;
    --be-warning: #F59E0B;
    --be-error: #EF4444;
}

/* Base Container - Enhanced with Inter font */
.bias-explorer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--be-text-primary);
    line-height: 1.6;
}

.bias-explorer-container * {
    box-sizing: border-box;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
    to { left: 100%; }
}

@keyframes pulse {
    0%, 100% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header Styles - Enhanced */
.be-header {
    background: linear-gradient(to bottom, var(--be-primary-dark) 0%, var(--be-primary) 40%, var(--be-secondary) 85%);
    color: var(--be-white);
    padding: 30px 40px 120px 40px;
    border-radius: 24px;
    margin-bottom: 40px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(42, 111, 151, 0.15);
    position: relative;
    overflow: hidden;
}
/* Add noise texture for depth */
.be-header::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' /%3E%3C/svg%3E");
    pointer-events: none;
    border-radius: inherit;
}

.be-header h1 {
    font-size: 3.5em;
    margin: 0 0 20px 0;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.1;
    background: linear-gradient(135deg, #FFFFFF 0%, rgba(255,255,255,0.85) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 20px rgba(0,0,0,0.1);
    animation: fadeInUp 0.8s ease-out;
    position: relative;
    z-index: 1;
}

.be-header p {
    font-size: 1.25em;
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
    animation: fadeInUp 0.8s ease-out 0.1s both;
}

/* Steps Guide */
.be-steps-guide {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
}

.be-steps-text-line {
    color: var(--be-white);
    opacity: 0.85;
    font-size: 1em;
    font-weight: 500;
    letter-spacing: 0.5px;
    margin: 0;
    padding: 0;
    background: none;
    border-radius: 0;
    backdrop-filter: none;
}

.be-steps-text-line .be-step-separator {
    margin: 0 15px;
    font-weight: bold;
    font-size: 1.2em;
    vertical-align: middle;
    color: rgba(255, 255, 255, 0.6);
}

/* Setup Card - Enhanced with gradient border effect */
.be-setup-card {
    background: var(--be-white);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 30px;
    position: relative;
}

.be-setup-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, var(--be-primary), var(--be-secondary), var(--be-accent));
    border-radius: 22px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.be-setup-card:hover::before {
    opacity: 0.3;
}

.be-setup-header {
    background: linear-gradient(135deg, var(--be-gray-100) 0%, var(--be-gray-200) 100%);
    padding: 30px 40px;
    border-bottom: 1px solid var(--be-gray-200);
}

.be-setup-header h2 {
    color: var(--be-text-primary);
    font-size: 1.8em;
    margin: 0 0 10px 0;
}

.be-setup-header p {
    color: var(--be-text-secondary);
    font-size: 1.1em;
    margin: 0;
}

/* Template Section */
.be-templates-section {
    padding: 40px;
    background: var(--be-gray-100);
    border-bottom: 1px solid var(--be-gray-200);
}

.be-templates-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.be-templates-header h3 {
    color: var(--be-text-primary);
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.be-template-toggle {
    display: flex;
    gap: 10px;
}

.be-toggle-btn {
    padding: 8px 16px;
    border: 2px solid var(--be-gray-300);
    background: var(--be-white);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: var(--be-text-secondary);
    font-size: inherit;
    font-family: inherit;
}

.be-toggle-btn:hover {
    border-color: var(--be-primary);
    color: var(--be-primary);
}

.be-toggle-btn.active {
    background: var(--be-primary);
    color: var(--be-white);
    border-color: var(--be-primary);
}

.be-templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Enhanced Template Cards */
.be-template-card {
    background: linear-gradient(135deg, #FFFFFF 0%, #FAFBFC 100%);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 
        0 1px 3px rgba(0,0,0,0.04),
        0 4px 8px rgba(0,0,0,0.03),
        0 12px 24px rgba(0,0,0,0.02);
    backdrop-filter: blur(10px);
}

.be-template-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(42, 111, 151, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(244, 162, 97, 0.05) 0%, transparent 50%);
    pointer-events: none;
    border-radius: inherit;
}

.be-template-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--be-primary);
}

.be-template-card.selected {
    border: 2px solid rgba(42, 111, 151, 0.3);
    background: linear-gradient(135deg, 
        rgba(42, 111, 151, 0.08) 0%, 
        rgba(42, 111, 151, 0.03) 100%);
    box-shadow: 
        0 0 0 4px rgba(42, 111, 151, 0.1),
        0 8px 32px rgba(42, 111, 151, 0.15);
}

.be-template-card.selected::after {
    content: '✓';
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--be-primary);
    color: var(--be-white);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* Enhanced Template Icons */
.be-template-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #F0F4F8 0%, #E1E8ED 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 20px 0;
    font-size: 28px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.be-template-card:hover .be-template-icon {
    transform: scale(1.1) rotate(-5deg);
}

.be-template-title {
    font-weight: 600;
    color: var(--be-text-primary);
    margin-bottom: 8px;
    font-size: 1.1em;
}

.be-template-desc {
    color: var(--be-text-secondary);
    font-size: 0.95em;
    line-height: 1.5;
}

/* Student Comparison */
.be-comparison-section {
    padding: 40px;
    background: var(--be-white);
}

.be-comparison-section > h3 {
    margin: 0 0 30px 0;
    color: var(--be-text-primary);
}

.be-comparison-visual {
    display: flex;
    align-items: stretch;
    gap: 30px;
    margin-bottom: 40px;
}

.be-student-column {
    flex: 1;
    background: var(--be-gray-100);
    border-radius: 16px;
    padding: 30px;
    position: relative;
    transition: all 0.3s ease;
}

.be-student-column.student-a {
    border: 3px solid var(--be-primary);
    background: linear-gradient(135deg, rgba(42, 111, 151, 0.05) 0%, rgba(42, 111, 151, 0.02) 100%);
}

.be-student-column.student-b {
    border: 3px solid var(--be-accent);
    background: linear-gradient(135deg, rgba(231, 111, 81, 0.05) 0%, rgba(231, 111, 81, 0.02) 100%);
}

.be-student-header {
    text-align: center;
    margin-bottom: 25px;
}

.be-student-avatar {
    width: 80px;
    height: 80px;
    background: var(--be-white);
    border-radius: 50%;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5em;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.be-student-label {
    font-size: 1.3em;
    font-weight: 700;
    margin: 0;
}

.be-student-column.student-a .be-student-label { color: var(--be-primary); }
.be-student-column.student-b .be-student-label { color: var(--be-accent); }

.be-student-description {
    background: var(--be-white);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.be-student-description textarea {
    width: 100%;
    border: none;
    outline: none;
    resize: vertical;
    font-family: inherit;
    font-size: 1em;
    line-height: 1.6;
    color: var(--be-text-primary);
    min-height: 100px;
    background: transparent;
    padding: 16px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.be-student-description textarea:focus {
    background: rgba(255, 255, 255, 0.8);
}

.be-vs-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    font-weight: bold;
    color: var(--be-text-secondary);
    position: relative;
}

/* Work Sample Section */
.be-work-sample-section {
    background: var(--be-gray-100);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
}

.be-work-sample-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.be-work-sample-header h3 {
    color: var(--be-text-primary);
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

/* Enhanced Form Controls */
.be-sample-select,
.be-form-control {
    padding: 12px 16px;
    border: 2px solid var(--be-gray-300);
    border-radius: 10px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #FAFBFC;
    color: var(--be-text-primary);
    font-family: inherit;
    min-width: 250px;
    width: auto;
    height: auto;           
    line-height: normal;    
    min-height: 0;          
    box-sizing: border-box; 
}

.be-sample-select:hover,
.be-form-control:hover {
    border-color: var(--be-primary);
}

.be-sample-select:focus,
.be-form-control:focus {
    outline: none;
    background: #FFFFFF;
    border-color: var(--be-primary);
    box-shadow: 
        0 0 0 4px rgba(42, 111, 151, 0.1),
        0 2px 8px rgba(42, 111, 151, 0.08);
    transform: translateY(-1px);
}

/* Enhanced Sample Preview with custom scrollbar */
.be-sample-preview {
    background: var(--be-white);
    border-radius: 12px;
    padding: 25px;
    font-family: 'Georgia', serif;
    line-height: 1.8;
    color: var(--be-text-primary);
    max-height: 250px;
    overflow-y: auto;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    white-space: pre-wrap;
}

.be-sample-preview::-webkit-scrollbar {
    width: 8px;
}

.be-sample-preview::-webkit-scrollbar-track {
    background: #F0F4F8;
    border-radius: 4px;
}

.be-sample-preview::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}

.be-sample-preview::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* Advanced Options */
.be-advanced-section {
    padding: 0 40px 40px;
}

.be-advanced-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 24px;
    background: var(--be-gray-100);
    border: 2px solid var(--be-gray-300);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    color: var(--be-text-secondary);
    transition: all 0.3s ease;
    margin-bottom: 25px;
    width: 100%;
    font-size: inherit;
    font-family: inherit;
}

.be-advanced-toggle:hover {
    background: var(--be-gray-200);
    border-color: var(--be-primary);
    color: var(--be-primary);
}

.be-advanced-toggle.active {
    background: var(--be-primary);
    color: var(--be-white);
    border-color: var(--be-primary);
}

.be-advanced-toggle svg {
    transition: transform 0.3s ease;
}

.be-advanced-toggle.active svg {
    transform: rotate(180deg);
}

.be-advanced-content {
    display: none;
    background: var(--be-gray-100);
    border-radius: 16px;
    padding: 30px;
}

.be-advanced-content.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.be-advanced-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.be-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.be-form-group label {
    font-weight: 600;
    color: var(--be-text-primary);
    font-size: 0.95em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.be-help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--be-gray-300);
    color: var(--be-text-secondary);
    border-radius: 50%;
    font-size: 11px;
    cursor: help;
    position: relative;
}

.be-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--be-text-primary);
    color: var(--be-white);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 15px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    margin-bottom: 8px;
    width: max-content;
    max-width: 350px;
    white-space: normal;
    z-index: 1000;
    font-weight: normal;
}

.be-help-icon:hover .be-tooltip,
.be-help-icon .be-tooltip:hover {
    opacity: 1;
    visibility: visible;
}

/* Model Selection */
.be-model-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.be-model-option {
    padding: 15px;
    border: 2px solid var(--be-gray-300);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    background: var(--be-white);
}

.be-model-option:hover {
    border-color: var(--be-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.be-model-option.selected {
    border-color: var(--be-primary);
    background: linear-gradient(135deg, rgba(42, 111, 151, 0.05) 0%, rgba(42, 111, 151, 0.02) 100%);
}

.be-model-option input {
    display: none;
}

.be-model-name {
    font-weight: 600;
    color: var(--be-text-primary);
    margin-bottom: 4px;
}

.be-model-provider {
    font-size: 0.85em;
    color: var(--be-text-secondary);
}

/* Slider */
.be-slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 10px;
}

.be-slider {
    flex: 1;
    height: 6px;
    background: var(--be-gray-300);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.be-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--be-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(42, 111, 151, 0.3);
}

.be-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--be-primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(42, 111, 151, 0.3);
}

.be-slider-value {
    font-weight: 600;
    color: var(--be-primary);
    min-width: 45px;
    text-align: center;
}

/* Checkbox */
.be-checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.be-checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Action Button - Enhanced */
.be-action-section {
    padding: 40px;
    background: linear-gradient(135deg, var(--be-gray-100) 0%, var(--be-gray-200) 100%);
    text-align: center;
}

.be-run-button {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--be-secondary) 0%, var(--be-secondary-dark) 100%);
    color: var(--be-white);
    border: none;
    padding: 18px 50px;
    font-size: 1.2em;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 24px rgba(244, 162, 97, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: inherit;
}

.be-run-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.be-run-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(244, 162, 97, 0.4);
}

.be-run-button:hover::before {
    width: 300px;
    height: 300px;
}

.be-run-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Results Section - Enhanced */
.be-results-card {
    background: var(--be-white);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-top: 30px;
    display: none;
}

.be-results-card.show {
    display: block;
    animation: slideInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.be-results-header {
    background: linear-gradient(135deg, var(--be-gray-100) 0%, var(--be-gray-200) 100%);
    padding: 40px;
    text-align: center;
    border-bottom: 1px solid var(--be-gray-200);
}

.be-results-header h2 {
    color: var(--be-text-primary);
    font-size: 2em;
    margin: 0 0 20px 0;
}

.be-bias-indicator {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 1.2em;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.be-bias-indicator.no-bias {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.be-bias-indicator.potential-bias {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

.be-bias-indicator.uncertain {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

/* Results Layers */
.be-results-layers {
    padding: 40px;
}

.be-result-layer {
    margin-bottom: 30px;
    padding: 30px;
    background: var(--be-gray-100);
    border-radius: 16px;
    position: relative;
}

.be-result-layer.collapsed .be-layer-content {
    display: none;
}

.be-layer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.be-layer-header h3 {
    color: var(--be-text-primary);
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.be-expand-btn {
    padding: 8px 16px;
    background: var(--be-white);
    border: 2px solid var(--be-gray-300);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    color: var(--be-text-secondary);
    transition: all 0.3s ease;
    font-size: inherit;
    font-family: inherit;
}

.be-expand-btn:hover {
    background: var(--be-primary);
    color: var(--be-white);
    border-color: var(--be-primary);
}

/* Story Results */
.be-story-section {
    font-size: 1.1em;
    line-height: 1.8;
    color: var(--be-text-primary);
}

.be-story-section p {
    margin-bottom: 20px;
}

.be-story-section p:last-child {
    margin-bottom: 0;
}

.be-story-highlight {
    background: linear-gradient(to bottom, transparent 40%, #ffd93d 40%, #ffd93d 60%, transparent 60%);
    padding: 2px 4px;
    font-weight: 600;
}

/* Score Visualization - Flexible Bars (No Scrolling) */
.be-scores-comparison {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin: 30px 0;
    overflow: visible;
}

.be-score-column {
    background: var(--be-white);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: visible; /* Changed to visible to allow tooltips */
}

.be-score-column::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

.be-score-column h4 {
    font-size: 1.2em;
    margin: 0 0 20px 0;
    position: relative;
}

.be-score-column.student-a h4 { color: var(--be-primary); }
.be-score-column.student-b h4 { color: var(--be-accent); }

/* Remove all scrolling-related styles */
.be-score-bars-wrapper {
    /* No overflow settings needed */
    padding-bottom: 15px;
    position: relative;
}

/* Make bars flexible to fit available space */
.be-score-bars {
    display: flex; /* Regular flex, not inline-flex */
    align-items: flex-end;
    justify-content: center; /* Center the bars */
    gap: 8px; /* Smaller default gap */
    height: 200px;
    width: 100%; /* Full width of container */
    padding: 0 10px;
}

/* Bars will shrink/grow to fit */
.be-score-bar {
    flex: 1 1 auto; /* Allow growing and shrinking */
    min-width: 20px; /* Minimum width when many bars */
    max-width: 60px; /* Maximum width when few bars */
    background: var(--be-primary);
    border-radius: 6px 6px 0 0;
    position: relative;
    transition: height 0.8s ease;
    cursor: pointer;
    overflow: hidden;
}

/* Adjust gap based on number of bars using container queries or JavaScript */
.be-score-bars.many-bars {
    gap: 4px; /* Smaller gap when many bars */
}

.be-score-bars.many-bars .be-score-bar {
    max-width: 40px; /* Smaller max width when many bars */
}

.be-score-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255,255,255,0.3) 50%, 
        transparent 100%);
    animation: shimmer 2s infinite;
}

.be-score-bar:hover {
    opacity: 0.8;
}

.be-score-bar.student-a {
    background: linear-gradient(to top, var(--be-primary), var(--be-primary-light));
}

.be-score-bar.student-b {
    background: linear-gradient(to top, var(--be-accent), var(--be-accent-light));
}

.be-score-label {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 600;
    font-size: 0.85em;
    color: var(--be-text-primary);
    white-space: nowrap;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.2s ease;
}

/* Show label on hover when not too crowded */
.be-score-bar:hover .be-score-label {
    opacity: 1;
}

/* Always show labels when few bars */
.be-score-bars:not(.many-bars) .be-score-label {
    opacity: 1;
}

.be-score-stats {
    display: flex;
    justify-content: space-around;
    padding-top: 20px;
    border-top: 2px solid var(--be-gray-200);
}

.be-stat-item {
    text-align: center;
}

.be-stat-label {
    font-size: 0.85em;
    color: var(--be-text-secondary);
    margin-bottom: 5px;
}

.be-stat-value {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--be-text-primary);
}

/* Technical Details */
.be-technical-details {
    background: var(--be-white);
    border-radius: 12px;
    padding: 25px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.9em;
    line-height: 1.6;
}

.be-technical-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--be-gray-200);
}

.be-technical-row:last-child {
    border-bottom: none;
}

/* Real-World Impact */
.be-impact-section {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe0e0 100%);
    border: 2px solid #ffcdd2;
    border-radius: 16px;
    padding: 30px;
    margin-top: 30px;
}

.be-impact-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.be-impact-icon {
    font-size: 2.5em;
}

.be-impact-title {
    font-size: 1.3em;
    color: #c62828;
    font-weight: 600;
    margin: 0;
}

.be-impact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.be-impact-card {
    background: var(--be-white);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.be-impact-number {
    font-size: 2.5em;
    font-weight: 700;
    color: #c62828;
    margin-bottom: 5px;
}

.be-impact-label {
    color: var(--be-text-secondary);
    font-size: 0.95em;
}

/* Discussion Prompts */
.be-discussion-section {
    background: linear-gradient(135deg, rgba(42, 111, 151, 0.1) 0%, rgba(42, 111, 151, 0.05) 100%);
    border-radius: 16px;
    padding: 30px;
    margin-top: 30px;
}

.be-discussion-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
}

.be-discussion-header h3 {
    color: var(--be-text-primary);
    font-size: 1.3em;
    margin: 0;
}

.be-discussion-prompts {
    display: grid;
    gap: 15px;
}

.be-prompt-card {
    background: var(--be-white);
    padding: 20px;
    border-radius: 12px;
    border-left: 4px solid var(--be-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.be-prompt-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.be-prompt-question {
    font-weight: 600;
    color: var(--be-text-primary);
    margin-bottom: 10px;
}

.be-prompt-context {
    color: var(--be-text-secondary);
    font-size: 0.95em;
    line-height: 1.6;
}

/* Share Section */
.be-share-section {
    background: var(--be-white);
    border-radius: 16px;
    padding: 30px;
    margin-top: 30px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.be-share-section h3 {
    margin: 0 0 10px 0;
    color: var(--be-text-primary);
}

.be-share-section > p {
    margin: 0 0 20px 0;
    color: var(--be-text-secondary);
}

.be-share-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.be-share-btn {
    padding: 12px 24px;
    border: 2px solid var(--be-gray-300);
    background: var(--be-white);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    color: var(--be-text-secondary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: inherit;
    font-family: inherit;
}

.be-share-btn:hover {
    background: var(--be-gray-100);
    border-color: var(--be-primary);
    transform: translateY(-2px);
}

/* Educational Tooltips */
.be-edu-tooltip {
    display: inline-block;
    margin-left: 5px;
    color: var(--be-primary);
    cursor: help;
    font-weight: 600;
    border-bottom: 2px dotted var(--be-primary);
    position: relative;
}

.be-edu-content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--be-white);
    border: 2px solid var(--be-primary);
    border-radius: 12px;
    padding: 20px;
    width: 300px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    margin-bottom: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

.be-edu-tooltip:hover .be-edu-content {
    opacity: 1;
    visibility: visible;
}

.be-edu-content h4 {
    color: var(--be-primary);
    margin: 0 0 10px 0;
    font-size: 1.1em;
}

.be-edu-content p {
    color: var(--be-text-primary);
    line-height: 1.6;
    margin: 0 0 10px 0;
}

.be-edu-visual {
    background: var(--be-gray-100);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    margin-top: 15px;
}

/* Loading Overlay - Enhanced */
.be-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(31, 41, 55, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.be-loading-overlay.show {
    display: flex;
}

.be-loading-content {
    background: var(--be-white);
    border-radius: 20px;
    padding: 50px;
    text-align: center;
    max-width: 450px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.be-loading-spinner {
    width: 60px;
    height: 60px;
    position: relative;
    margin: 0 auto 30px;
}

.be-loading-spinner::before,
.be-loading-spinner::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
}

.be-loading-spinner::before {
    border-top-color: var(--be-primary);
    animation: spin 1.2s linear infinite;
}

.be-loading-spinner::after {
    border-bottom-color: var(--be-secondary);
    animation: spin 1.2s linear infinite reverse;
    opacity: 0.6;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.be-loading-text {
    font-size: 1.3em;
    color: var(--be-text-primary);
    margin-bottom: 15px;
    font-weight: 600;
}

.be-loading-steps {
    margin-top: 25px;
    text-align: left;
    position: relative;
}

.be-loading-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: #E1E8ED;
    z-index: -1;
}

.be-loading-step {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
    color: var(--be-text-secondary);
    opacity: 0.5;
    transition: all 0.3s ease;
}

.be-loading-step.active {
    opacity: 1;
    color: var(--be-primary);
    font-weight: 500;
}

.be-loading-step.complete {
    opacity: 1;
    color: var(--be-success);
}

.be-loading-step.complete .be-step-icon {
    background: var(--be-success);
    color: white;
    border-color: var(--be-success);
}

.be-step-icon {
    width: 24px;
    height: 24px;
    border: 2px solid currentColor;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Responsive Design - Enhanced */
@media (max-width: 768px) {
    .bias-explorer-container {
        padding: 10px;
    }
    
    .be-header {
        padding: 40px 20px;
    }
    
    .be-header h1 {
        font-size: 2em;
    }
    
    .be-header p {
        font-size: 1.1em;
    }
    
    .be-comparison-visual {
        flex-direction: column;
        gap: 20px;
    }
    
    .be-vs-indicator {
        transform: rotate(90deg);
        margin: 20px 0;
    }
    
    .be-templates-grid {
        grid-template-columns: 1fr;
    }
    
    .be-template-card {
        min-height: 120px;
        padding: 20px;
    }
    
    .be-scores-comparison {
        grid-template-columns: 1fr;
    }
    
    .be-model-grid {
        grid-template-columns: 1fr;
    }
    
    .be-share-buttons {
        flex-direction: column;
    }
    
    .be-share-btn {
        width: 100%;
        justify-content: center;
    }
    
    .be-run-button {
        width: 100%;
        padding: 16px 30px;
    }
    
    /* Touch-friendly inputs */
    .be-form-control,
    .be-sample-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 14px 18px;
        min-height: 48px; /* Better for touch */
    }
    
    .be-advanced-toggle {
        font-size: 16px;
    }
    
    /* Stack comparison columns with animation */
    .be-student-column {
        transform: scale(0.98);
        transition: transform 0.3s ease;
    }
    
    .be-student-column:active {
        transform: scale(0.96);
    }
}

/* Tablet optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    .be-templates-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .be-model-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .be-impact-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Print Styles */
@media print {
    .bias-explorer-container {
        max-width: 100%;
    }
    
    .be-header {
        background: none;
        color: var(--be-text-primary);
        box-shadow: none;
        border: 2px solid var(--be-primary);
    }
    
    .be-setup-card,
    .be-loading-overlay,
    .be-share-section,
    .be-expand-btn {
        display: none !important;
    }
    
    .be-results-card {
        box-shadow: none;
        border: 1px solid var(--be-gray-300);
    }
    
    .be-result-layer {
        page-break-inside: avoid;
    }
    
    .be-score-bar {
        background: var(--be-gray-300) !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}

/* Infographic Section */
.be-infographic-section {
    background: var(--be-gray-100);
    border-radius: 16px;
    padding: 30px;
    margin-top: 30px;
    border-top: 1px solid var(--be-gray-200);
}

.be-infographic-section h3 {
    color: var(--be-text-primary);
    font-size: 1.3em;
    margin: 0 0 20px 0;
    text-align: center;
}

#beInfographicOutput {
    text-align: center;
    margin-top: 20px;
    padding: 10px;
    border: 1px dashed var(--be-gray-300);
    border-radius: 8px;
    min-height: 100px;
    background: var(--be-white);
}

#beInfographicOutput img {
    max-width: 100%;
    border: 1px solid var(--be-gray-300);
    border-radius: 8px;
    margin-top: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#beInfographicOutput p {
    color: var(--be-text-secondary);
}

.be-infographic-section .be-form-group {
    margin-bottom: 15px;
}

.be-infographic-section .be-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--be-text-secondary);
}

/* Range values */
.be-range-value {
    margin-left: 8px;
    padding: 0.25em 0.5em;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    display: inline-block;
}

.be-range-moderate-variance { background: #fef3c7; color: #d97706; }
.be-range-high-variance { background: #fee2e2; color: #dc2626; }

/* Infographic bias messages */
.be-infographic-bias-message {
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    text-align: center;
    font-weight: bold;
    font-size: 0.95em;
}

.be-infographic-bias-message.potential-bias {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

.be-infographic-bias-message.no-bias {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.be-infographic-bias-message.uncertain {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

/* Sharing Section */
.sharing-section {
    padding: 48px 40px;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--be-text-primary);
    margin-bottom: 12px;
}

.section-header p {
    color: var(--be-text-secondary);
    font-size: 16px;
    line-height: 1.6;
}

/* Primary Actions */
.primary-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.action-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.action-button svg {
    width: 20px;
    height: 20px;
}

.btn-twitter {
    background-color: #000;
    color: white;
}

.btn-twitter:hover {
    background-color: #333;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn-linkedin {
    background-color: #0077b5;
    color: white;
}

.btn-linkedin:hover {
    background-color: #005885;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 119, 181, 0.3);
}

.btn-facebook {
    background-color: #1877f2;
    color: white;
}

.btn-facebook:hover {
    background-color: #165ecc;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(24, 119, 242, 0.3);
}

/* Secondary Actions */
.secondary-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.btn-secondary {
    flex: 1;
    min-width: 200px;
    padding: 16px 24px;
    border: 2px solid var(--be-primary);
    border-radius: 10px;
    background: var(--be-white);
    color: var(--be-primary);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-secondary:hover {
    border-color: var(--be-primary);
    color: var(--be-primary);
    background-color: #f0f8ff;
    transform: translateY(-2px);
}

.btn-secondary svg {
    width: 20px;
    height: 20px;
}

/* Share Text Section */
.share-text-section {
    background: var(--be-gray-100);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    position: relative;
}

.share-text-label {
    font-size: 14px;
    color: var(--be-text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.share-text-content {
    background: white;
    border: 1px solid var(--be-gray-200);
    border-radius: 8px;
    padding: 20px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--be-text-primary);
    margin-bottom: 16px;
    min-height: 100px;
    white-space: pre-wrap;
}

.copy-button {
    position: absolute;
    top: 24px;
    right: 24px;
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--be-gray-200);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--be-text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.copy-button:hover {
    background: var(--be-primary);
    color: white;
    border-color: var(--be-primary);
}

.copy-button.copied {
    background: var(--be-success);
    color: white;
    border-color: var(--be-success);
}

/* Restart Section */
.restart-section {
    border-top: 1px solid var(--be-gray-200);
    padding-top: 32px;
    text-align: center;
}

.btn-restart {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    background: transparent;
    border: 1px solid var(--be-gray-200);
    border-radius: 8px;
    color: var(--be-text-secondary);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-restart:hover {
    border-color: #95a5a6;
    color: var(--be-text-primary);
}

.btn-restart svg {
    width: 18px;
    height: 18px;
}

/* Responsive sharing section */
@media (max-width: 600px) {
    .sharing-section {
        padding: 32px 20px;
    }
    
    .primary-actions {
        grid-template-columns: 1fr;
    }
    
    .secondary-actions {
        flex-direction: column;
    }
    
    .btn-secondary {
        min-width: 100%;
    }
}

/* Temporarily hide specific share buttons */
.be-share-buttons .be-share-btn[data-action="twitter"],
.be-share-buttons .be-share-btn[data-action="handout"]{
    display: none;
}

/* Variability indicator */
.be-variability-indicator {
    background: var(--be-gray-100);
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
}

.be-consistency-bars {
    margin-top: 15px;
}

.be-consistency-item {
    margin-bottom: 12px;
}

.be-consistency-bar {
    background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
    height: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    color: white;
    font-weight: 600;
    font-size: 0.85em;
    transition: width 0.6s ease;
}

.be-info-notice {
    background: #e0f2fe;
    border: 1px solid #0284c7;
    color: #075985;
    padding: 12px 20px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 0.95em;
    text-align: center;
}

.be-variability-note {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 15px 20px;
    margin-top: 20px;
    border-radius: 0 8px 8px 0;
}

.be-bias-disclaimer {
    margin-top: 15px;
    padding: 12px 20px;
    background: #fef3c7;
    border-radius: 8px;
    color: #92400e;
    font-size: 0.95em;
    text-align: center;
}

.be-try-again-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 16px;
    padding: 30px;
    margin-top: 30px;
    border: 2px solid #0284c7;
}

.be-try-again-section h3 {
    color: #075985;
    margin: 0 0 15px 0;
}

.be-suggestion-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.be-suggestion-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.be-suggestion-icon {
    font-size: 2em;
    margin-bottom: 10px;
}

.be-suggestion-title {
    font-weight: 600;
    color: var(--be-text-primary);
    margin-bottom: 8px;
}

.be-suggestion-text {
    font-size: 0.9em;
    color: var(--be-text-secondary);
    line-height: 1.4;
}

.be-results-context {
    margin-top: 15px;
    font-style: italic;
    color: var(--be-text-secondary);
    font-size: 0.95em;
}

/* Clickable "Try Again" Section */
.be-try-again-section.be-clickable-section {
    cursor: pointer;
    transition: all 0.3s ease;
}

.be-try-again-section.be-clickable-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(2, 132, 199, 0.25);
    border-color: #0369a1;
}

/* "Start Here" badge */
.be-recommended-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--be-success);
    color: var(--be-white);
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 6px;
    letter-spacing: 0.5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Special styling for Visual Summary section */
.be-visual-summary-layer {
    background: linear-gradient(135deg, #fff5eb 0%, #fee4cf 100%);
    border: 2px solid var(--be-secondary);
    box-shadow: 0 4px 20px rgba(244, 162, 97, 0.15);
    position: relative;
    overflow: hidden;
}

.be-visual-summary-layer::before {
    content: '✨';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    opacity: 0.5;
}

.be-visual-summary-layer .be-layer-header {
    background: linear-gradient(135deg, var(--be-secondary-light) 0%, var(--be-secondary) 100%);
    color: white;
    padding: 20px 30px;
}

.be-visual-summary-layer .be-layer-header h3 {
    color: white;
    font-weight: 700;
}

.be-visual-summary-layer .be-expand-btn {
    background: white;
    color: var(--be-secondary-dark);
    border: 2px solid white;
    font-weight: 600;
}

.be-visual-summary-layer .be-expand-btn:hover {
    background: var(--be-secondary-dark);
    color: white;
}

.btn-email {
    background-color: #6c757d;
    color: white;
}

.btn-email:hover {
    background-color: #545b62;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.3);
}


.be-export-section {
    padding: 30px 40px;
    background: var(--be-gray-100);
    border-top: 1px solid var(--be-gray-200);
    text-align: center;
}

.be-export-section h3 {
    margin: 0 0 20px 0;
    color: var(--be-text-primary);
    font-size: 1.3em;
}

.be-export-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.be-human-score {
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.1em;
    background: #f0f4f8;
    padding: 10px;
    border-radius: 8px;
    color: var(--be-text-primary);
}

/* Tooltip styling for score bars */
.be-score-bar {
    position: relative; /* Already set, but ensure it's there */
}

/* Tooltip that appears on hover */
.be-score-bar::before {
    content: attr(data-score) " points";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: var(--be-text-primary);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Arrow pointing down from tooltip */
.be-score-bar::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-2px);
    border: 5px solid transparent;
    border-top-color: var(--be-text-primary);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    z-index: 101;
}

/* Show tooltip on hover */
.be-score-bar:hover::before,
.be-score-bar:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-12px);
}

.be-score-bar:hover::after {
    transform: translateX(-50%) translateY(-6px);
}

/* Different tooltip colors for Student A vs Student B */
.be-score-bar.student-a::before {
    background: var(--be-primary);
}

.be-score-bar.student-a::after {
    border-top-color: var(--be-primary);
}

.be-score-bar.student-b::before {
    background: var(--be-accent);
}

.be-score-bar.student-b::after {
    border-top-color: var(--be-accent);
}

/* Hide regular labels when many bars (they conflict with tooltips) */
.be-score-bars.many-bars .be-score-label {
    display: none !important;
}

/* On touch devices, show tooltip on tap */
@media (hover: none) and (pointer: coarse) {
    .be-score-bar.touched::before,
    .be-score-bar.touched::after {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(-12px);
    }
    
    .be-score-bar.touched::after {
        transform: translateX(-50%) translateY(-6px);
    }
}

/* Ensure tooltip doesn't get cut off at edges */
.be-score-column {
    padding-top: 50px; /* Add space for tooltips */
}

.be-score-column h4 {
    margin-top: -20px; /* Compensate for extra padding */
}

/* Alternative: Inline tooltip style (appears inside the bar) */
.be-score-bar.inline-tooltip::before {
    content: attr(data-score);
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: none;
    color: white;
    padding: 0;
    border-radius: 0;
    font-size: 14px;
    font-weight: 700;
    opacity: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    box-shadow: none;
}

.be-score-bar.inline-tooltip::after {
    display: none;
}

.be-score-bar.inline-tooltip:hover::before {
    opacity: 1;
    transform: translateX(-50%);
}

/* Special styling for writing content bias scenario */
.be-template-card.writing-content-bias-scenario {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid rgba(245, 158, 11, 0.3);
}

.be-template-card.writing-content-bias-scenario::before {
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(245, 158, 11, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(251, 191, 36, 0.1) 0%, transparent 50%);
}

.be-template-card.writing-content-bias-scenario:hover {
    border-color: var(--be-warning);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.15);
}

.be-template-card.writing-content-bias-scenario.selected {
    border: 2px solid rgba(245, 158, 11, 0.5);
    background: linear-gradient(135deg, 
        rgba(245, 158, 11, 0.12) 0%, 
        rgba(245, 158, 11, 0.05) 100%);
    box-shadow: 
        0 0 0 4px rgba(245, 158, 11, 0.15),
        0 8px 32px rgba(245, 158, 11, 0.2);
}

/* Notice for writing content bias mode */
#differentSamplesSection .be-info-notice {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95em;
    border-left: 4px solid currentColor;
}

/* Highlight the work sample fields when in writing content bias mode */
.be-template-card.writing-content-bias-scenario.selected ~ * #differentSamplesSection textarea {
    border-color: var(--be-warning);
    background: rgba(245, 158, 11, 0.03);
}

/* Special styling for consistency/variability scenarios */
.be-template-card.variability-scenario {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid rgba(245, 158, 11, 0.3);
}

.be-template-card.variability-scenario::before {
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(245, 158, 11, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(251, 191, 36, 0.1) 0%, transparent 50%);
}

.be-template-card.variability-scenario:hover {
    border-color: var(--be-warning);
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.15);
}

.be-template-card.variability-scenario.selected {
    border: 2px solid rgba(245, 158, 11, 0.5);
    background: linear-gradient(135deg, 
        rgba(245, 158, 11, 0.12) 0%, 
        rgba(245, 158, 11, 0.05) 100%);
    box-shadow: 
        0 0 0 4px rgba(245, 158, 11, 0.15),
        0 8px 32px rgba(245, 158, 11, 0.2);
}