.dataset-container {
    display: flex;
    height: 100%;
}

.dataset-summary {
    width: 28%; /* Slightly smaller */
    display: flex;
    flex-direction: column;
    padding: 1rem;
    min-height: 0;
    max-height: 100vh; /* Prevent growing too tall */
    overflow: auto;
    background-image: linear-gradient(var(--bg-light), var(--bg), var(--bg-dark));
    border: 1px solid var(--border);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 16px;
}

.dataset-right {
    width: 72%; /* Adjust to match */
    display: flex;
    flex-direction: column;
    padding: 10px;
    min-height: 0;
    gap: 8px; /* Reduce gap */
}

/* Dataset features styling */
.dataset-features {
    width: 100%;
}

.dataset-distribution {
    height: 80%;
    width: 100%;
    max-height: calc(80vh - 120px); /* Prevent growing too tall */
    overflow: hidden;
}

hr {
    width: 90%;
    border: none;
    border-top: 1px solid var(--border);
    margin: 15px auto; /* Reduce margin */
}

.dataset-title {
    text-align: center;
    margin-bottom: 10px;
    color: var(--text);
    font-size: 1.2em;
    font-weight: 600;
}

/* Combined info section for side-by-side layout */
.combined-info-section {
    margin-bottom: 10px; /* Reduce margin */
}

.info-container {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.info-card {
    flex: 1;
    border: 1px solid var(--border);
    background-color: var(--bg);
    border-radius: 4px;
    overflow: hidden;
}

.info-card-title {
    text-align: center;
    margin: 0;
    padding: 8px; /* Reduce padding */
    color: var(--text);
    font-size: 0.95em; /* Smaller font */
    font-weight: 500;
    background-color: var(--bg-light);
    border-bottom: 1px solid var(--border);
}

.info-card-content {
    padding: 0.5rem; /* Reduce padding */
}

.info-item-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0; /* Reduce padding */
    border-bottom: 1px solid var(--border);
}

.info-item-compact:last-child {
    border-bottom: none;
}

.info-label-compact {
    color: var(--text);
    font-weight: 500;
    font-family: "Montserrat";
    font-size: 0.9em; /* Smaller font */
}

.info-value-compact {
    color: var(--text-muted);
    font-family: "Montserrat";
    font-size: 0.9em; /* Smaller font */
}

/* Collapsible section styling */
.collapsible-section {
    margin-bottom: 10px; /* Reduce margin */
    border: 1px solid var(--border);
    background-color: var(--bg);
    border-radius: 4px;
    overflow: hidden;
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: var(--bg-light);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    color: var(--text);
    font-size: 0.95em;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.collapsible-header:hover {
    background-color: var(--secondary);
}

.collapsible-header span {
    font-family: 'Montserrat';
}

.collapse-icon {
    color: var(--text-muted);
    font-size: 0.8em;
}

/* Collapsible content improvements */
.collapsible-content {
    padding: 0.75rem;
    background-color: var(--bg);
}

/* Correlation matrix section */
.correlation-section {
    margin-bottom: 10px;
}

.correlation-content {
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.5rem; 
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    cursor: pointer; 
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.correlation-content:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: var(--primary);
}

.correlation-plot {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.correlation-plot::after {
    font-family: 'Montserrat';
    content: "Click to expand";
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.7em;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.correlation-content:hover .correlation-plot::after {
    opacity: 1;
}

.correlation-plot svg {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}

.correlation-placeholder {
    color: var(--text-muted);
    font-size: 1em;
    text-align: center;
}

/* Splits navigation - positioned above first HR */
.splits-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0 0.5rem 0;
}

.split-text {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 16px;
    font-family: "Montserrat";
    padding: 0.25rem 0.5rem;
    margin: 0px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.split-text:hover {
    background-color: var(--bg);
    color: var(--secondary);
}

.split-text.selected {
    color: var(--primary);
    font-weight: 600;
}

/* Features navigation - remove extra space */
.features-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.75rem;
    background-image: linear-gradient(var(--bg-light), var(--bg), var(--bg-dark));
    border: 1px solid var(--border);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    height: fit-content;
}

.feature-text {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 16px;
    font-family: "Montserrat";
    padding: 0.5rem 1rem;
    margin: 0.25rem;
    cursor: pointer;
    transition: color 0.2s ease;
    border-radius: 4px;
}

.feature-text:hover {
    background-color: var(--bg);
    color: var(--secondary);
}

.feature-text.selected {
    color: var(--primary);
    font-weight: 600;
    background-color: var(--bg-light);
}

/* Distribution layout - fixed height */
.distribution-layout {
    display: flex;
    height: 100%;
    background-image: linear-gradient(var(--bg-light), var(--bg), var(--bg-dark));
    border: 1px solid var(--border);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin: 0;
}

.distribution-table-container {
    width: 50%;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-dark);
    border-right: 1px solid var(--border);
    padding: 1rem;
    overflow: auto;
}

.distribution-plot-container {
    width: 50%;
    display: flex;
    flex-direction: column;
    background-color: var(--bg);
    padding: 1rem;
}

.feature-title {
    color: var(--text);
    text-align: center;
    margin: 0 0 1rem 0;
    font-size: 1.1em;
    font-weight: 600;
}

/* Distribution table styling */
.distribution-table {
    font-family: "Montserrat";
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg);
    margin: 0;
}

.distribution-table th,
.distribution-table td {
    text-align: center;
    font-size: 0.9em;
    padding: 0.5rem;
    color: var(--text);
    border: 1px solid var(--border);
}

.distribution-table th {
    background-color: var(--bg-light);
    font-weight: bold;
    font-size: 1em;
}

/* Plot placeholder */
.plot-placeholder {
    width: 200px;
    height: 200px;
    background-color: white;
    border: 1px solid var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1em;
    font-family: "Montserrat";
}

/* Dataset splits container */
.dataset-splits {
    padding: 0.5rem 0;
}

/* Splits navigation - positioned in dataset-splits div */
.splits-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin: 0;
}

.split-text {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 16px;
    font-family: "Montserrat";
    padding: 0.25rem 0.5rem;
    margin: 0px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.split-text:hover {
    background-color: var(--bg);
    color: var(--secondary);
}

.split-text.selected {
    color: var(--primary);
    font-weight: 600;
}

/* Dataset features styling */
.dataset-features {
    width: 100%;
}

/* Distribution table improvements */
.distribution-table-container .table-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.distribution-table-container .data-table {
    font-family: "Montserrat";
    width: 100%;
    border-collapse: collapse;
    background-color: var(--bg);
    border: 1px solid var(--border);
    flex: 1;
}

.distribution-table-container .data-table th,
.distribution-table-container .data-table td {
    text-align: center;
    font-size: 0.9em;
    padding: 0.5rem;
    border: 1px solid var(--border);
    color: var(--text);
}

.distribution-table-container .data-table th {
    background-color: var(--bg-light);
    font-weight: bold;
    font-size: 1em;
}

.distribution-table-container .table-description {
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.5rem;
    padding: 0.5rem;
    text-align: center;
    display: block !important;
    font-size: 0.9em;
}

/* Plot styling within distribution */
.distribution-plot-container .plot-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.distribution-plot-container .plot-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-bottom: 1rem;
    min-height: 300px;
    overflow: hidden;
}

.distribution-plot-container .plot-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.distribution-plot-container .plot-image svg {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.distribution-plot-container .plot-description {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 0.5rem;
    margin: 0;
    flex-shrink: 0;
    font-size: 0.9em;
}

/* No data message styling */
.no-data-message {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 2rem;
    margin: 0;
    font-size: 1em;
}

/* Correlation Matrix Modal */
.correlation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.correlation-modal.show {
    opacity: 1;
    visibility: visible;
}

.correlation-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: transform 0.3s ease;
    overflow: auto;
}

.correlation-modal.show .correlation-modal-content {
    transform: scale(1);
}

.correlation-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.correlation-modal-title {
    font-size: 1.3em;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.correlation-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.correlation-modal-close:hover {
    background-color: var(--bg-light);
    color: var(--text);
}

.correlation-modal-plot {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.correlation-modal-plot svg {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}

/* Backdrop blur for page content when modal is open */
body.modal-open .dataset-container {
    filter: blur(2px);
    transition: filter 0.3s ease;
}
