/* General Body Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    color: #212529;
}

/* Header and Footer */
header, footer {
    text-align: center;
    padding: 1.5rem 1rem;
}

header {
    background-color: #343a40;
    color: #ffffff;
}

header h1 {
    margin: 0;
    font-size: 2.5rem;
}

header p {
    margin: 0.5rem 0 0;
    font-size: 1.1rem;
    color: #adb5bd;
}

footer {
    color: #212529;
}

footer p {
    margin: 0;
}

footer a {
    color: #9bf;
    text-decoration: none;
}

/* Main Navigation */
.main-nav {
    background-color: #495057;
    padding: 0.5rem 1rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-nav a {
    color: #f8f9fa;
    margin: 0 15px;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.main-nav a.active,
.main-nav a:hover {
    background-color: #6c757d;
}

/* Main Content Layout */
main {
    padding: 2rem 1rem;
}

.content-wrapper {
    display: flex;
    max-width: 1600px;
    margin: 0 auto;
}

/* Sidebar for Jump-to Links */
.sidebar {
    width: 240px;
    position: sticky;
    top: 70px; /* Adjust based on main-nav height */
    align-self: flex-start;
    height: calc(100vh - 90px); /* Adjust based on header/nav height */
    overflow-y: auto;
    padding-right: 20px;
}

.jump-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.jump-nav li a {
    display: block;
    padding: 8px;
    text-decoration: none;
    color: #495057;
    border-left: 3px solid transparent;
    transition: all 0.3s;
    font-size: 0.9rem; /* Smaller font for sidebar */
}

.jump-nav li a:hover {
    background-color: #e9ecef;
    border-left-color: #007bff;
}

/* Styles for new dynamic elements */
.results-tabs {
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #dee2e6;
    display: flex; /* Arrange tabs in a row */
}

.tab-link {
    background: none;
    border: none;
    font-size: 1.1rem; /* Slightly smaller font */
    padding: 12px 22px; /* Adjusted padding */
    cursor: pointer;
    margin-bottom: -2px; /* Align with bottom border */
    border-bottom: 3px solid transparent; /* Inactive state */
    color: #495057; /* Subtler color for inactive tabs */
    transition: all 0.3s ease; /* Smooth transition */
}

.tab-link:hover {
    background-color: #e9ecef; /* Subtle hover effect */
    border-bottom-color: #adb5bd; /* Hover border color */
}

.tab-link.active {
    border-bottom-color: #007bff;
    font-weight: 600;
    color: #212529; /* Darker color for active tab */
}

#compare-btn {
    width: 100%;
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px;
    font-size: 1rem;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 20px;
}

#compare-btn:hover {
    background-color: #0056b3;
}

.sidebar-category {
    margin-top: 15px;
    margin-bottom: 5px;
    color: #495057;
}

.sidebar-subcategory {
    font-size: 0.95rem;
    font-weight: bold;
    color: #6c757d; /* Grey color */
    margin-top: 10px;
    margin-bottom: 5px;
    padding-left: 10px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.checkbox-container label {
    margin-left: 8px;
    font-size: 0.9rem;
    color: #212529;
}

.jump-link {
    margin-left: 8px;
    font-size: 0.9rem;
    color: #212529;
    text-decoration: none;
}

.jump-link:hover {
    text-decoration: underline;
}


/* Main plots area */
.plots-main {
    flex: 1;
    padding-left: 20px;
}

.plots-main h2, .plots-main h3 {
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 0.5rem;
    margin-top: 2rem;
}

.plots-main h2 {
    font-size: 2rem;
}

.plots-main h3 {
    font-size: 1.75rem;
    color: #495057;
}

.plot-container {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.plot-container h4 {
    margin-top: 0;
    text-align: center;
    font-size: 1.5rem;
    color: #343a40;
}

.plot-container img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    width: 75%; /* Resize plots to 75% of the container */
}

/* Forcing scroll to land correctly */
.plot-container[id] {
  scroll-margin-top: 100px; /* Must be slightly larger than nav height */
}

/* Source Script Link */
.source-script-link {
    display: block;
    text-align: center;
    margin-top: 10px;
    font-size: 0.75rem;
    color: #6c757d;
    text-decoration: none;
}

.source-script-link:hover {
    text-decoration: underline;
}

/* Floating compare bar inside sidebar */
.sidebar .compare-bar {
    position: sticky;
    bottom: 0;
    background: #343a40;
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    width: 100%;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.3);
}
.sidebar .compare-bar.hidden {
    display: none;
}
.compare-bar button {
    background: #007bff;
    color: #fff;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
}
.compare-bar button:hover {
    background: #0069d9;
} 