/* --- Global Styles & Fonts --- */
body {
  font-family: 'Noto Sans', sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f8f8;
  margin: 0;
  padding-top: 20px;
  overflow-x: hidden;
  width: 100%;
}

h1, h2, h3 {
    font-family: 'Google Sans', sans-serif;
    text-align: center;
    margin-bottom: 10px;
}

h1.main-title {
    font-size: 2.8rem;
    color: #000000;
    margin-top: -15px;
}

h2 {
    font-size: 2.2rem;
    /* margin-top: 40px; */
    margin-bottom: 15px;
}

h3 {
    font-size: 1.2rem;
    font-weight: normal;
    color: #666;
    margin-bottom: 20px;
}

p {
    max-width: 800px;
    margin: 0 auto 20px auto;
    text-align: justify;
    color: #444;
}

/* --- Layout Containers --- */
.main-content {
    flex-grow: 1;
    padding: 0;
}

section {
    width: 100%;
    padding: 15px 0;
    box-sizing: border-box;
}

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

.white-bg {
    background-color: #fff;
}

.grey-bg {
    background-color: #f3f7fa;
    border-top: 1px solid #e9e9e9;
    border-bottom: 1px solid #e9e9e9;
}

/* --- Header & Intro Section --- */
.author-list {
    text-align: center;
    margin-top: -10px;
    margin-bottom: 20px;
    font-size: 1.5em;
    color: #555;
}
.author-block a {
   color: hsl(204, 86%, 53%) !important;
   text-decoration: none;
}
.author-block a:hover {
    text-decoration: underline;
}

.publication-authors {
    font-family: 'Google Sans', sans-serif;
}

.org-logos {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
    flex-wrap: wrap;
    align-items: center;
}

.org-logo img {
    height: 25px;
    width: auto;
    max-width: 150px;
    object-fit: contain;
}

.summary-text {
    font-size: 0.9em;
    text-align: center;
    margin-bottom: 0;
    line-height: 1.8;
    color: #444;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.action-button {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    min-width: 150px; /* Minimum width for buttons */
    background-color: #e0e0e0; /* Grey background */
    color: #333; /* Dark text for contrast */
    text-decoration: none;
    border-radius: 40px; /* More rounded corners */
    font-weight: bold;
    transition: background-color 0.3s ease;
    white-space: nowrap;
    justify-content: center;
    border: 1px solid #ccc;
    font-size: 1.1em;
}
.action-button:hover {
    background-color: #cccccc; /* Darker grey on hover */
    color: #333;
}
.action-button img {
    height: 20px;
    width: 20px;
    margin-right: 8px;
    vertical-align: middle;
    /* filter property removed to show normal images */
}

/* --- Sticky Navbar --- */
.sticky-nav {
    position: fixed;
    top: -100px;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 10px 20px;
    display: flex;
    /* justify-content: space-between; */
    align-items: center;
    z-index: 1000;
    transition: top 0.3s ease-in-out;
}
.sticky-nav.visible {
    top: 0;
}
.sticky-nav .nav-title {
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
}
.sticky-nav .nav-links {
    display: flex;
    gap: 12px;
    margin-left: auto;
    margin-right: 30px;
}
.sticky-nav .nav-links .action-button {
  padding: 4px 12px;
  font-size: 1.1em;
}
.hamburger {
    display: none;
    font-size: 24px;
    background: none;
    border: none;
    color: #333;
    cursor: pointer;
}

/* --- Table Styles --- */
#main-results-table-container {
    overflow-x: auto; /* For responsiveness */
}
table {
    width: 80%;
    border-collapse: collapse;
    margin: 25px auto;
    font-size: 1em;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}
table thead tr {
    background-color: #0079AF;
    color: #ffffff;
    text-align: left;
}
table th, table td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    text-align: center;
}
table tbody tr:nth-of-type(even) {
    background-color: #fcfcfc;
}
table tbody tr:hover {
    background-color: #f1f1f1;
}
table tbody tr:last-of-type {
    border-bottom: 2px solid #0079AF;
}

/* --- Chart Styles --- */
.chart-container {
    margin-top: 20px;
    width: 100%;
    max-width: 850px;
    min-height: 400px;
    margin-left: auto;
    margin-right: auto;
}
.pie-chart-container {
    max-width: 500px;
    min-height: 450px;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    h1.main-title { font-size: 2rem; }
    h2 { font-size: 1.8rem; }
    table { width: 95%; font-size: 0.9em; }
    .sticky-nav .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: #fff;
        flex-direction: column;
        padding: 10px;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    .sticky-nav .nav-links.active {
        display: flex;
    }
    .hamburger {
        display: block;
    }
}

.subtitle {
    padding: 0 0 0 2%;
    font-size: 1.2rem;
    font-weight: normal;
    color: #666;
    border-left: thick solid #a4a3a5;
}

.subsection-title {
    font-size: 1.5em;
    color: #333;
    text-align: center;
    margin-top: 50px;
    margin-bottom: 20px;
    border-bottom: 2px solid #0079AF;
    display: inline-block;
    padding-bottom: 5px;
}

.process-container {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    margin: 20px 0 40px 0;
    flex-wrap: wrap;
}

.process-step {
    flex: 1;
    min-width: 280px;
    padding: 25px;
    text-align: center;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.process-step:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.process-step i {
    font-size: 3em;
    color: #0079AF;
    margin-bottom: 20px;
}

.process-step h4 {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: #333;
}

.process-step p {
    text-align: justify;
    font-size: 0.95em;
    color: #555;
    margin-bottom: 0;
}

.behavior-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin: 20px 0 40px 0;
}

.behavior-card {
    padding: 20px;
    text-align: center;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.behavior-card i {
    font-size: 2.5em;
    color: #0079AF;
    margin-bottom: 15px;
}

.behavior-card h4 {
    font-size: 1.2em;
    margin-bottom: 10px;
}

.behavior-card p {
    font-size: 0.9em;
    color: #555;
    text-align: center;
    margin-bottom: 0;
}

.judge-container {
    display: flex;
    align-items: center;
    gap: 25px;
    background-color: #e8f2fe;
    border-left: 5px solid #0079AF;
    padding: 25px;
    border-radius: 8px;
    margin-top: 20px;
}

.judge-icon i {
    font-size: 3.5em;
    color: #0079AF;
}

.judge-text h4 {
    text-align: left;
    margin-top: 0;
    margin-bottom: 10px;
}

.judge-text p {
    text-align: justify;
    margin-bottom: 0;
}

@media (max-width: 600px) {
    .judge-container {
        flex-direction: column;
        text-align: center;
    }
    .judge-text h4 {
        text-align: center;
    }
}

.dual-chart-container {
    display: flex;
    flex-direction: row;
    gap: 40px; /* Space between the two chart columns */
    margin-top: 30px;
}

.dual-chart-container .chart-container {
    flex: 1; /* Each chart takes up half the space */
    min-width: 0; /* Important for flexbox sizing */
    margin-left: 0;
    margin-right: 0;
}

.chart-title {
    font-size: 1.3em;
    font-weight: 600;
    color: #333;
    text-align: center;
    margin-bottom: 15px;
}

.dual-chart-container .chart-container p {
    font-size: 0.95em;
    text-align: justify;
    padding: 0 10px; /* Add a little horizontal padding */
    min-height: 100px; /* Helps align charts if text lengths differ */
}

/* On smaller screens, stack the charts vertically */
@media (max-width: 992px) {
    .dual-chart-container {
        flex-direction: column;
        gap: 50px;
    }
    .dual-chart-container .chart-container p {
        min-height: auto; /* Reset min-height on mobile */
    }
}

.mitigation-section h3 {
    font-size: 1.5em;
    color: #333;
    text-align: left;
    margin-top: 40px;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 2px solid #0079AF;
}

.mitigation-section .chart-container {
    max-width: 800px; /* Allow single charts to be a bit wider */
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 2px solid #ccc;
    margin-bottom: 20px;
}

.tab-button {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background-color: transparent;
    font-size: 1.1em;
    font-weight: 600;
    color: #555;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease-in-out;
}

.tab-button:hover {
    background-color: #f0f0f0;
    color: #000;
}

.tab-button.active {
    color: #0079AF;
    border-bottom: 3px solid #0079AF;
}

.tab-content {
    display: none; /* Hidden by default */
}

.tab-content.active {
    display: block; /* Shown when active */
}

.trace-box {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    max-height: 350px; 
    overflow-y: auto;
}

.trace-box h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.2em;
    text-align: left;
    color: #333;
}

.trace-box p {
    white-space: pre-wrap; /* Preserves line breaks in the text */
    font-family: 'Noto Sans', sans-serif;
    font-size: 1em;
    margin-bottom: 0;
    text-align: justify;
    padding-right: 15px; 
}

/* Specific border colors for different boxes */
.trace-box.original-problem { border-left: 5px solid #0079AF; } /* Blue */
.trace-box.sycophantic-problem { border-left: 5px solid #e67e22; } /* Orange */
.trace-box.model-solution { border-left: 5px solid #27ae60; } /* Green */
.trace-box.judgement { border-left: 5px solid #c0392b; } /* Red */

.judgement-header {
    font-weight: bold;
    font-size: 1.1em;
    margin-right: 10px;
}

.katex-html {
    display: none;
}

.citation-block {
    background-color: #e8f2fe;
    border-left: 5px solid #0079AF;
    padding: 20px;
    margin-top: 40px;
    border-radius: 8px;
    font-family: 'Noto Sans', sans-serif;
    font-size: 1.2em;
    color: #333;
    overflow-x: auto;
    width: 100%;
}