* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: system-ui, sans-serif;
    line-height: 1.4;
    color: #555879;
    background: #F4EBD3;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    color: #555879;
    margin-top: 30px;
    margin-bottom: 30px;
}

h2 {
    color: #555879;
    margin: 10px 0 20px 0;
    text-align: center;
    justify-items: center;
}

.main-section-title {
    text-align: center;
}

.section {
    background: #DED3C4;
    font-size: 1rem;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(85, 88, 121, 0.1);
}



.category {
    margin-bottom: 25px;
    background: #DED3C4;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(85, 88, 121, 0.1);
}

.category-header {
    background: #555879;
    color: #F4EBD3;
    padding: 15px 20px;
    font-weight: bold;
}

.subcategory {
    border-bottom: 1px solid rgba(152, 161, 188, 0.3);
}

.subcategory:last-child {
    border-bottom: none;
}

.subcategory-header {
    background: #F4EBD3;
    padding: 12px 20px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.3s ease;
}

.subcategory-header:hover {
    background: rgba(152, 161, 188, 0.2);
}

.subcategory-title {
    display: flex;
    align-items: center;
}

.subcategory-title::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 6px solid #98A1BC;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    margin-right: 10px;
    transition: transform 0.3s ease;
}

.subcategory-header.expanded .subcategory-title::before {
    transform: rotate(90deg);
}

.model-results {
    display: none;
}

.model-results.show {
    display: block;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th {
    background: #98A1BC;
    color: #F4EBD3;
    padding: 10px;
    text-align: center;
    font-size: 0.9em;
}

.results-table td {
    padding: 8px 12px;
    text-align: center;
    border-bottom: 1px solid rgba(152, 161, 188, 0.2);
    font-family: monospace;
    font-size: 0.9em;
}

.results-table tr:nth-child(even) {
    background: rgba(244, 235, 211, 0.5);
}

/* Details View Styles */
.breadcrumb {
    margin-bottom: 20px;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
}

.breadcrumb a {
    color: #98A1BC;
    text-decoration: none;
    font-weight: bold;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    color: #666;
    margin-left: 10px;
}

#details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

#details-controls {
    display: flex;
    gap: 30px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.filter-controls,
.sort-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-controls label,
.sort-controls label {
    font-weight: bold;
    color: #333;
}

.filter-controls select,
.sort-controls select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.details-button {
    background: #98A1BC;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.details-button:hover {
    background: #7a8399;
}

.image-result {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
}

.image-result-header {
    background: #f8f9fa;
    padding: 15px 20px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.3s ease;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid #ddd;
}

/* Sticky header when expanded */
.image-result-header.expanded.sticky {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #f8f9fa;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(85, 88, 121, 0.15);
    border-bottom: 2px solid #98A1BC;
}

.image-result-header:hover {
    background: rgba(152, 161, 188, 0.1);
}

.image-result-title {
    display: flex;
    align-items: center;
    color: #98A1BC;
    font-size: 16px;
    width: 100%;
}

.image-name {
    display: flex;
    align-items: center;
    flex: 1;
}

.average-accuracy {
    font-size: 0.9em;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    color: white;
    min-width: 50px;
    text-align: center;
    margin-left: auto;
    flex-shrink: 0;
}

.average-accuracy.no-data {
    background-color: #6c757d;
    color: white;
}

.average-accuracy.accuracy-very-low {
    background-color: #8b0000;
    /* dark red */
}

.average-accuracy.accuracy-low {
    background-color: #dc3545;
    /* red */
}

.average-accuracy.accuracy-medium {
    background-color: #ffc107;
    /* yellow */
    color: #000;
}

.average-accuracy.accuracy-good {
    background-color: #90ee90;
    /* light green */
    color: #000;
}

.average-accuracy.accuracy-excellent {
    background-color: #006400;
    /* dark green */
}

.image-result-title::before {
    content: '';
    width: 0;
    height: 0;
    border-left: 6px solid #98A1BC;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    margin-right: 10px;
    transition: transform 0.3s ease;
}

.image-result-header.expanded .image-result-title::before {
    transform: rotate(90deg);
}

.image-result-content {
    display: none;
    padding: 20px;
}

.image-result-content.show {
    display: block;
}

.ground-truth {
    background: #f8f9fa;
    border-left: 4px solid #98A1BC;
    padding: 15px;
    margin-bottom: 15px;
}

.ground-truth h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.ground-truth-text {
    font-family: monospace;
    background: white;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.model-responses {
    display: grid;
    gap: 15px;
}

.model-response {
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 15px;
}

.model-response h5 {
    color: #98A1BC;
    margin: 0 0 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.model-metrics {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #666;
}

.metric {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
}

.model-response-text {
    font-family: monospace;
    background: #fafafa;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.diff-button {
    background: #6c757d;
    color: white;
    border: none;
    padding: 3px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
}

.diff-button:hover {
    background: #5a6268;
}

.diff-view {
    margin-top: 10px;
    font-family: monospace;
    background: white;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.diff-added {
    background-color: #d4edda;
    color: #155724;
}

.diff-removed {
    background-color: #f8d7da;
    color: #721c24;
}

/* Mobile responsiveness for details view */
@media (max-width: 768px) {
    #details-header {
        flex-direction: column;
        align-items: stretch;
    }

    #details-controls {
        flex-direction: column;
        gap: 15px;
    }

    .filter-controls,
    .sort-controls {
        justify-content: center;
        margin-top: 10px;
    }

    .model-responses {
        grid-template-columns: 1fr;
    }

    .model-metrics {
        flex-wrap: wrap;
        gap: 8px;
    }

    .subcategory-header {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .subcategory-title {
        justify-content: flex-start;
    }

    .details-button {
        align-self: flex-end;
        font-size: 10px;
        padding: 4px 8px;
    }
}

.model-name {
    text-align: left !important;
    font-family: system-ui, sans-serif !important;
    font-weight: 500;
}

.model-link {
    color: #555879;
    text-decoration: none;
    transition: color 0.2s ease;
}

.model-link:hover {
    color: #98A1BC;
    text-decoration: underline;
}

.loading,
.no-data {
    text-align: center;
    padding: 40px;
    color: #98A1BC;
}

.best-score {
    background: rgba(152, 161, 188, 0.3) !important;
    color: #555879;
    font-weight: bold;
}

/* Hero Section Styles */
.hero-section {
    text-align: center;
    padding: 40px 0 60px 0;
    margin-bottom: 20px;
}

.hero-title {
    font-size: 3.2em;
    font-weight: 700;
    color: #555879;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.title-link {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: opacity 0.2s ease;
}

.title-link:hover {
    opacity: 0.8;
    color: inherit;
}

.logo {
    height: 1.5em;
    width: auto;
    object-fit: contain;
}

.beta-tag {
    background: linear-gradient(135deg, #98A1BC, #555879);
    color: #F4EBD3;
    font-size: 0.22em;
    font-weight: 400;
    padding: 2px 6px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(85, 88, 121, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.hero-subtitle {
    font-size: 1.2em;
    color: #98A1BC;
    margin-bottom: 25px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #555879;
    color: #F4EBD3;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border: none;
}

.social-link:hover {
    background: #98A1BC;
    color: #F4EBD3;
}

.social-icon {
    width: 18px;
    height: 18px;
    fill: #F4EBD3;
}

.disclaimer {
    background: linear-gradient(135deg, #DED3C4, #F4EBD3);
    border: 1px solid #98A1BC;
    border-radius: 8px;
    font-size: 0.8rem;
    padding: 20px;
    margin: 30px auto 25px auto;
    max-width: 800px;
    box-shadow: 0 2px 8px rgba(85, 88, 121, 0.2);
}

.disclaimer p {
    color: #555879;
    font-size: 0.95em;
    line-height: 1.6;
    margin: 0;
    text-align: left;
}

.disclaimer strong {
    color: #555879;
    font-weight: 600;
}

/* Metrics Explanation Section */
.metrics-explanation {
    padding: 25px 0;
    margin: 10px auto 75px auto;
    max-width: 1200px;
}

.metrics-explanation h3 {
    color: #555879;
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

/* Step-based metrics layout */
.metrics-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    align-items: stretch;
}

.metric-step {
    display: flex;
    flex-direction: column;
    flex: 1 1 calc(25% - 15px);
    min-width: 260px;
    background: linear-gradient(135deg, #F4EBD3, #DED3C4);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #98A1BC;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: auto;
    box-shadow: 0 4px 12px rgba(85, 88, 121, 0.15);
}

.metric-step:hover {
    box-shadow: 0 6px 20px rgba(85, 88, 121, 0.25);
}

.step-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.step-number {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #98A1BC, #555879);
    color: #F4EBD3;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85em;
    box-shadow: 0 2px 6px rgba(85, 88, 121, 0.3);
    margin-top: 2px;
}

.step-content {
    flex: 1;
}

.step-content h4 {
    color: #555879;
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.2;
}

.step-content p {
    color: #555879;
    font-size: 0.8em;
    line-height: 1.4;
    margin-bottom: 10px;
}

.step-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
}

.visual-label {
    font-size: 0.7em;
    color: #98A1BC;
    font-weight: 500;
}

/* Accuracy bar visualization */
.accuracy-bar {
    width: 80px;
    height: 8px;
    background: rgba(152, 161, 188, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.accuracy-fill {
    height: 100%;
    background: linear-gradient(90deg, #98A1BC, #555879);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Error indicators */
.error-indicators {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.error-type {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    font-weight: bold;
    color: white;
}

.error-type.insertion {
    background: #28a745;
}

.error-type.deletion {
    background: #dc3545;
}

.error-type.substitution {
    background: #ffc107;
    color: #333;
}

/* Word comparison */
.word-comparison {
    display: flex;
    gap: 6px;
    margin-left: 12px;
    align-items: center;
    justify-content: center;
    background: rgba(152, 161, 188, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
}

.word {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.8em;
    font-family: monospace;
}

.word.correct {
    background: #d4edda;
    color: #155724;
}

.word.error {
    background: #f8d7da;
    color: #721c24;
    text-decoration: line-through;
}

/* Time indicator */
.time-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(152, 161, 188, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
}

.clock-icon {
    font-size: 1.1em;
}

.time-value {
    font-family: monospace;
    font-weight: 600;
    color: #555879;
}



@media (max-width: 768px) {
    .metrics-explanation {
        margin: 25px 10px 20px 10px;
        padding: 20px;
    }

    .metrics-steps {
        flex-direction: column;
        gap: 16px;
    }

    .metric-step {
        flex: 1 1 100%;
        min-width: auto;
        padding: 14px;
    }

    .step-header {
        gap: 10px;
        margin-bottom: 8px;
    }

    .step-number {
        width: 26px;
        height: 26px;
        font-size: 0.8em;
    }

    .step-content h4 {
        font-size: 0.95em;
    }

    .step-content p {
        font-size: 0.75em;
        margin-bottom: 8px;
    }

    .step-visual {
        flex-wrap: wrap;
        gap: 6px;
        padding-top: 6px;
    }

    .visual-label {
        font-size: 0.65em;
    }


}

.simple-footer {
    text-align: center;
    padding: 30px 20px;
    color: #98A1BC;
    font-size: 0.9em;
    margin-top: 40px;
}

.update {
    padding: 20px;
    color: #98A1BC;
    font-weight: 500;
}

/* Image Icon and Tooltip Styles */
.image-icon-container {
    position: relative;
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}

.image-icon {
    color: #98A1BC;
    cursor: pointer;
    transition: color 0.2s ease;
    vertical-align: middle;
}

.image-icon:hover {
    color: #555879;
}

.image-tooltip {
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    background: white;
    border: 2px solid #98A1BC;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 4px 12px rgba(85, 88, 121, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
    pointer-events: none;
    min-width: 700px;
    max-width: 900px;
    margin-left: 8px;
}

.image-icon-container:hover .image-tooltip {
    opacity: 1;
    visibility: visible;
}

.image-tooltip img {
    width: 100%;
    height: auto;
    max-height: 800px;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

/* Tooltip arrow pointing left */
.image-tooltip::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -6px;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: #98A1BC;
}

.image-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -5px;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: white;
}

/* Tooltip positioning adjustments for mobile */
@media (max-width: 768px) {
    .image-tooltip {
        position: fixed;
        bottom: auto;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        max-width: 90vw;
        max-height: 80vh;
        margin-bottom: 0;
    }

    .image-tooltip img {
        max-height: 60vh;
    }

    /* Hide arrows on mobile */
    .image-tooltip::before,
    .image-tooltip::after {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5em;
        flex-direction: column;
        gap: 10px;
    }

    .logo {
        height: 1.5em;
    }

    .social-links {
        gap: 10px;
    }

    .social-link {
        padding: 8px 14px;
        font-size: 0.85em;
    }

    .disclaimer {
        margin: 25px 10px 20px 10px;
        padding: 15px;
    }

    .disclaimer p {
        font-size: 0.9em;
    }
}