/* Base styles */
body {
    font-family: 'Georgia', serif;
    background-color: #fdf8e1;
    color: #333;
    margin: 0;
    padding: 0;
    font-size: 16px; /* Default font size */
}

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

h1 {
    text-align: left;
    color: #b8860b;
    font-family: 'Alegreya';
    font-size: 1.6em;
    margin-bottom: 6px;
}

h2 {
    text-align: left;
    font-family: 'Alegreya', cursive;
    color: #b8860b;
    font-size: 2em; /* Smaller than h1 */
}

#leaderboard a {
    text-decoration: none;
    font-weight: bold;
    color: #b8860b; 
}

.results-summary {
    margin: 10px 0 14px 0;
    color: #8b6914;
    font-weight: 600;
}

#leaderboard a:hover {
    text-decoration: none; 
    color: #cd853f; 
}


.intro { margin: 6px 0 16px 0; }

.intro p {
    margin: 0 0 10px;
    font-size: 1em; /* Same as the base font size */
}

.intro a {
    color: #b8860b;
    text-decoration: none;
}

.intro a:hover {
    text-decoration: underline;
    color: #cd853f;
}

/* Hero/top text */
.hero { 
    background: #fefcf5; 
    border: 1px solid #e8e0d0; 
    border-radius: 12px; 
    padding: 20px 24px; 
    margin-bottom: 20px; 
    color: #5a4a3c;
    line-height: 1.65;
    font-size: 16px;
}
.hero .lead { font-size: 1.05em; color: #66543b; margin-bottom: 10px; }
.hero b { color: #8b6914; }
.hero p { margin: 0 0 12px 0; }
.hero p:last-child { margin-bottom: 0; }
.hero a {
    color: #7a6b4c;
    text-decoration: none;
    border-bottom: 1px dotted #b0a08b;
    transition: all 0.2s ease;
}
.hero a:hover {
    color: #8b6914;
    border-bottom-color: #8b6914;
    background-color: #f8f5f0;
    padding: 2px 4px;
    border-radius: 3px;
    margin: -2px -4px;
}

.intro a i, .intro a .fab {
    margin-right: 5px;
}

.intro iframe {
    margin: 20px 0;
    display: block;
    height: 600px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

table th, table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
    font-size: 1em; /* Match table text size to the body text size */
}

table th {
    background-color: #b8860b;
    color: white;
    padding: 12px 15px; /* Increase padding for better spacing */
    text-align: left; /* Align header text to the left */
}

table tr:nth-child(even) {
    background-color: #f9f9f9;
}

table tr:hover {
    background-color: #f1f1f1;
}

.filter-container {
    text-align: left;
    border: 1px solid #b8860b;
    border-radius: 8px;
    padding: 14px;
    background-color: #fffaf7;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 12px;
    font-size: 1em; /* Match filter container text size to the body text size */
}
.layout { display: grid; grid-template-columns: 320px minmax(0,1fr); gap: 20px; align-items: start; }
.sidebar { position: static; max-height: none; overflow: visible; }
.content { min-width: 0; }


/* Facet controls (year/genre/length) */
.facet-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 10px 0 14px 0;
}

.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    border: 1px solid #e3c9b6;
    background: #fff;
    color: #8b6914;
    padding: 6px 10px;
    border-radius: 999px;
    cursor: pointer;
    user-select: none;
    font-size: 0.95em;
}
.chip.active { background: #8b6914; color: #fff; border-color: #8b6914; }

.filter-help { font-size: 0.95em; color: #59584e; background:#f8f1e9; border:1px solid #f0e0d0; border-radius:8px; padding:8px 10px; margin-bottom:10px; }

.facet-label {
    display: block;
    font-weight: 600;
    color: #8b6914;
    margin-bottom: 6px;
}

.facet-select, .facet-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    font-size: 1em;
}

.length-range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.length-sep { color: #b8860b; font-weight: 600; }

.sidebar-actions { margin-top: 12px; }

.filter-controls {
    display: flex;
    align-items: center;
    gap: 10px; /* Add space between elements */
}

.checkbox-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 1em; /* match checkbox text size to the body text size */
}

.filter-label {
    display: flex;
    align-items: center;
    font-size: 1em; /* match filter label text size to the body text size */
}

.filter-label.pill { border: 1px solid #e3c9b6; padding: 6px 10px; border-radius: 10px; background: #fff; gap: 6px; }

.active-filters {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.active-filter-chip {
    background: #f7f0e7;
    color: #8b6914;
    border: 1px solid #efd9c9;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.9em;
}

.sticky-filter { position: sticky; top: 0; z-index: 100; }

.filter-label i {
    margin-right: 5px;
}

.model-selection {
    width: 100%;
    margin-bottom: 10px;
}

.clear-button {
    background-color: #e17624;
    color: rgb(255, 255, 255);
    border: none;
    padding: 6px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em; /* Match clear button text size to the body text size */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    white-space: nowrap; /* Prevent text from wrapping */
}

.clear-button:hover {
    background-color: #c04909;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
}

.sort-arrow {
    font-size: 0.8em;
    margin-left: 5px;
    visibility: hidden; /* Hide arrows by default */
}

.sortable:hover .sort-arrow {
    visibility: visible; /* Show arrows on hover */
}

.asc .sort-arrow {
    visibility: visible;
}

.asc .sort-arrow::before {
    content: "\u25B2"; /* Up arrow */
}

.desc .sort-arrow {
    visibility: visible;
}

.desc .sort-arrow::before {
    content: "\u25BC"; /* Down arrow */
}

.prompt {
    margin: 20px 0;
    text-align: center;
}

.prompt h2 {
    margin-bottom: 10px;
    color: #b8860b;
    font-size: 2em;
    cursor: pointer;
}

.prompt h2:hover, .team-header:hover, .leaderboard-header:hover {
    color: #cd853f;
}

.prompt h2, .team-header, .leaderboard-header {
    cursor: pointer;
}

.robotic-text {
    font-family: 'Courier New', Courier, monospace;
    background-color: #e0e0e0;
    padding: 20px;
    border-radius: 8px;
    display: inline-block;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    text-align: left;
    white-space: pre-wrap;
    width: 100%;
    box-sizing: border-box;
    font-size: 1em; /* match robotic text size to the body text size */
}

.team-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    padding: 20px 0;
}

.team-member {
    text-align: center;
    flex: 0 1 200px;
    max-width: 200px;
}

.team-img {
    border-radius: 50%;
    width: 150px;
    height: 150px;
    object-fit: cover;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 105, 20, 0.3);
    border: 3px solid #b8860b;
}

.team-img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(139, 105, 20, 0.5);
}

.team-member p {
    color: #b8860b;
    font-weight: bold;
    margin-top: 15px;
    font-size: 1.1em;
}

.team-member a {
    color: #b8860b;
    text-decoration: none;
    transition: color 0.3s ease;
}

.team-member a:hover {
    color: #cd853f;
    text-decoration: underline;
}

/* Contact and Citation sections */
.contact, .citation {
    margin-top: 30px;
}

.contact-header, .citation-header {
    cursor: pointer;
    transition: color 0.3s ease;
}

.contact-header:hover, .citation-header:hover {
    color: #cd853f;
}

.contact-section, .citation-section {
    padding: 20px;
    background-color: #fafafa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    margin-top: 10px;
}

.contact-section p {
    margin: 0;
    font-size: 1.1em;
    line-height: 1.6;
}

.contact-section code {
    background-color: #f4f4f4;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    color: #8b6914;
    font-weight: bold;
}

.citation-section pre {
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    overflow-x: auto;
    margin: 0;
}

.citation-section code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    line-height: 1.4;
    color: #333;
}

/* Leaderboard styles */
.leaderboard-section {
    margin-top: 20px;
    padding: 20px;
    background-color: #fafafa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.leaderboard-info-box {
    margin: 20px 0;
    padding: 15px 20px;
    background-color: #f8f9fa !important;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    border-left: 4px solid #8b6914;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    width: auto !important;
}

.leaderboard-info-box p {
    margin: 0;
    color: #374151;
    font-size: 14px;
    line-height: 1.5;
}

/* Leaderboard Table Styles */
.leaderboard-table-section {
    margin-top: 20px;
    padding: 20px;
    background-color: #fafafa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.leaderboard-table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    border-radius: 10px;
    overflow: hidden;
}

.leaderboard-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.leaderboard-table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95em;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.leaderboard-table th.rank-col {
    width: 80px;
    text-align: center;
}

.leaderboard-table th.model-col {
    width: 200px;
}

.leaderboard-table th.score-col {
    width: 120px;
    text-align: center;
}

.leaderboard-table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid #e9ecef;
}

.leaderboard-table tbody tr:hover {
    background-color: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.leaderboard-table td {
    padding: 12px;
    font-size: 0.9em;
}

.rank-cell {
    text-align: center;
    font-weight: 600;
    position: relative;
}

.rank-icon {
    margin-right: 5px;
    font-size: 1.1em;
}



.model-row.rank-1 .rank-icon {
    color: #ffd700; /* Gold */
}

.model-row.rank-2 .rank-icon {
    color: #c0c0c0; /* Silver */
}

.model-row.rank-3 .rank-icon {
    color: #cd7f32; /* Bronze */
}

.model-row.rank-1 {
    background: linear-gradient(90deg, rgba(255,215,0,0.1) 0%, rgba(255,215,0,0.05) 100%);
}

.model-row.rank-2 {
    background: linear-gradient(90deg, rgba(192,192,192,0.1) 0%, rgba(192,192,192,0.05) 100%);
}

.model-row.rank-3 {
    background: linear-gradient(90deg, rgba(205,127,50,0.1) 0%, rgba(205,127,50,0.05) 100%);
}

.model-cell {
    font-weight: 500;
    color: #2c3e50;
    font-family: 'Courier New', monospace;
}

.score-cell {
    text-align: center;
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

.overall-score {
    font-weight: 700;
    color: #2c3e50;
    background: rgba(103, 126, 234, 0.1);
    border-radius: 4px;
}

.baseline-row {
    background: rgba(108, 117, 125, 0.1);
    border-top: 2px solid #6c757d;
    font-style: italic;
}

.baseline-row .model-cell {
    color: #6c757d;
}

.stats-container {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 10px;
    flex: 1;
    min-width: 150px;
}

.stat-item h3 {
    color: #b8860b;
    font-size: 2em;
    margin: 0 0 5px 0;
    font-family: 'Alegreya', cursive;
}

.stat-item p {
    color: #666;
    margin: 0;
    font-size: 0.9em;
}

.stat-item small {
    color: #888;
    font-size: 0.8em;
}

#leaderboard-chart {
    background-color: #fff;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.caution-flag {
    border: 1px solid #ff7700;
    border-radius: 8px;
    background-color: #ffffff; 
    padding: 15px;
    margin-bottom: 20px;
    font-size: 1em; /* Match caution flag text size to the body text size */
    color: #333;
    box-shadow: 0 4px 8px rgba(183, 6, 45, 0.1); 
}

.caution-flag a {
    text-decoration: none; /* Remove underline from links */
    color:  #b8860b; 
}

.caution-flag a:hover {
    text-decoration: underline;
}

.caution-flag a i {
    margin-right: 5px; 
}



.example {
    margin: 20px 0;
    text-align: center;
}

.example-header {
    margin-bottom: 10px;
    color: #b8860b;
    font-size: 2em;
    cursor: pointer;
}

.example-header:hover {
    color: #cd853f;
}

.example-content {
    display: none; 
    background-color: #e0e0e0;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(203, 147, 237, 0.2);
    text-align: left;
    font-size: 1em;
}

.example-content p {
    margin: 10px 0;
}

.example-content a {
    color: #b8860b;
    text-decoration: none;
}

.example-content a:hover {
    text-decoration: underline;
}


/* Style for the metadata rows */
/* Highlight the entire row on hover */
#leaderboard tbody tr:hover {
    background-color: #f1f1f1;
    transition: background-color 0.3s ease;
}

/* Style for the triangle toggle icon */
.toggle-icon {
    cursor: pointer;
    margin-right: 12px; /* Add more space between icon and text */
    font-size: 0.9em;
    color: #b8860b;
    display: inline-block;
    vertical-align: middle;
    transition: transform 0.3s ease;
}

/* Rotate the icon when expanded */
.toggle-icon.expanded {
    transform: rotate(90deg); /* Rotate to indicate expansion */
}

/* Slight color change on hover to make it more interactive */
.toggle-icon:hover {
    color: #cd853f;
}

/* Style for the metadata row */
#leaderboard tbody tr td div {
    margin: 5px 0;
    font-size: 0.9em; /* Slightly smaller text for metadata */
}

/* Optional: smoother appearance of metadata row */
#leaderboard tbody tr {
    transition: background-color 0.3s ease, height 0.3s ease;
}




/* mobile devices */
@media (max-width: 480px) {
    body {
        font-size: 9px; 
    }

    .container {
        margin: 15px;
        padding: 10px;
    }

    h1 {
        font-size: 1.3em; 
    }

    h2 {
        font-size: 1.2em; 
    }

    .intro p, 
    .filter-container, 
    .checkbox-container, 
    .prompt h2, 
    .robotic-text, 
    .caution-flag, 
    .example-header, 
    .example-content {
        font-size: 0.9em; 
    }

    table th, table td {
        padding: 6px;
        font-size: 0.9em;
        text-align: left !important; 
    }

    .clear-button {
        font-size: 0.9em; 
        padding: 6px 8px; 
    }

    .filter-label, 
    .filter-label i {
        font-size: 0.9em; 
    }

    .model-selection {
        font-size: 0.9em; /* ensure dropdown font size is consistent */
    }

    .team-member {
        flex: 0 1 150px;
        max-width: 150px;
    }
    
    .team-section {
        gap: 15px;
    }
    
    .team-img {
        width: 120px;
        height: 120px;
    }

    #leaderboard {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .layout { grid-template-columns: 1fr; }
    .sidebar { position: static; }

    .example-content p {
        margin: 10px 0;
    }
}

/* Responsive Design for Tablets */
@media (max-width: 768px) {
    body {
        font-size: 9px; 

    .container {
        margin: 20px;
        padding: 15px;
    }

    h1 {
        font-size: 1.4em;
    }

    h2 {
        font-size: 1.2em;
    }

    .prompt h2,
    .example-header {
        font-size: 1.2em;
    }

    .intro p,
    .filter-container,
    .checkbox-container,
    .robotic-text,
    .caution-flag,
    .example-content {
        font-size: 1em;
    }

    .select2-container--default .select2-search--inline .select2-search__field {
        background: transparent;
        border: none;
        outline: 0;
        box-shadow: none;
        width: calc(100% - 110px);
        box-sizing: border-box;
    }

    /* Table adjustments */
    table {
        width: 100%;
        table-layout: fixed; /* Ensures table respects set widths */
        border-collapse: collapse; /* Optional, for better appearance */
    }

    table th, table td {
        padding: 8px;
        font-size: 1em;
        text-align: left !important;
        overflow: hidden;          /* Hide overflowed content */
        text-overflow: ellipsis;    /* Add ellipsis for overflowed text */
        white-space: nowrap;        /* Prevent text from wrapping */
    }

    /* Limit the width of the first column */
    table th:first-child,
    table td:first-child {
        width: 50%;                /* Adjust percentage as needed */
    }

    /* Set width for the second column */
    table th:nth-child(2),
    table td:nth-child(2) {
        width: 30%;                /* Adjust percentage as needed */
    }

    /* Allow text wrapping in the first column if needed */
    table th:first-child,
    table td:first-child {
        white-space: normal;       /* Allow text to wrap */
        word-wrap: break-word;     /* Break long words */
    }

    .filter-container {
        font-size: 0.8em;
        padding: 4px 4px;
    }

    .clear-button {
        font-size: 0.8em;
        padding: 4px 5px;
    }

    .filter-label,
    .filter-label i {
        font-size: 1em;
    }

    .model-selection {
        font-size: 1em;
    }

    .team-member {
        flex: 0 1 180px; max-width: 180px;
    
    .team-section {
        gap: 20px;
    }
    }

    #leaderboard {
        display: block;
        overflow-x: auto;          /* Allow horizontal scrolling */
        /* white-space: nowrap; */  /* Remove to allow table to adjust */
        -webkit-overflow-scrolling: touch;
    }

    .example-content p {
        margin: 10px 0;
    }
}

/* Responsive Design for Medium Screens */
@media (max-width: 1380px) {
    body {
        font-size: 9px;
    }

    .container {
        margin: 20px;
        padding: 15px;
    }

    h1 {
        font-size: 1.4em;
    }

    h2 {
        font-size: 1.2em;
    }

    .prompt h2,
    .example-header {
        font-size: 1.2em;
    }

    .intro p,
    .filter-container,
    .checkbox-container,
    .robotic-text,
    .caution-flag,
    .example-content {
        font-size: 1em;
    }

    .select2-container--default .select2-search--inline .select2-search__field {
        background: transparent;
        border: none;
        outline: 0;
        box-shadow: none;
        width: calc(100% - 110px);
        box-sizing: border-box;
    }

    /* Table adjustments */
    table {
        width: 100%;
        table-layout: fixed;       /* Ensures table respects set widths */
        border-collapse: collapse; /* Optional, for better appearance */
    }

    table th, table td {
        padding: 8px;
        font-size: 1em;
        text-align: left !important;
        overflow: hidden;          /* Hide overflowed content */
        text-overflow: ellipsis;    /* Add ellipsis for overflowed text */
        white-space: nowrap;        /* Prevent text from wrapping */
    }

    /* Limit the width of the first column */
    table th:first-child,
    table td:first-child {
        width: 40%;                /* Adjust percentage as needed */
    }

    /* Set width for the second column */
    table th:nth-child(2),
    table td:nth-child(2) {
        width: 30%;                /* Adjust percentage as needed */
    }

    /* Allow text wrapping in the first column if needed */
    table th:first-child,
    table td:first-child {
        white-space: normal;       /* Allow text to wrap */
        word-wrap: break-word;     /* Break long words */
    }

    .filter-container {
        font-size: 0.8em;
        padding: 4px 4px;
    }

    .clear-button {
        font-size: 0.8em;
        padding: 4px 5px;
    }

    .filter-label,
    .filter-label i {
        font-size: 1em;
    }

    .model-selection {
        font-size: 1em;
    }

    .team-member {
        flex: 0 1 200px; max-width: 200px;
    
    .team-section {
        gap: 25px;
    }
    }

    #leaderboard {
        display: block;
        overflow-x: auto;          /* Allow horizontal scrolling */
        /* white-space: nowrap; */  /* Remove to allow table to adjust */
        -webkit-overflow-scrolling: touch;
        width: 100%;
        padding: 0 15px;
        box-sizing: border-box;
    }

    .example-content p {
        margin: 10px 0;
    }
}
/* Footer link styling */
footer a {
    color: #8b6914 !important;
    text-decoration: none;
}

footer a:hover {
    color: #6d5210 !important;
    text-decoration: underline;
}
