/* Dataset Details Page Styles */
.dataset-details-page {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
}

.dataset-details-card {
    background-color: var(--card-color);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 0rem 2rem;
}

.dataset-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.dataset-header h2 {
    margin: 0;
    color: var(--primary-color);
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

.dataset-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    margin-top: 1rem;
    padding-top: 2rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-item .label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.875rem;
}

.info-item .value {
    color: var(--primary-color);
    font-size: 1rem;
    word-break: break-word;
}

.dataset-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.dataset-section h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.section-header h3 {
    margin: 0;
}

/* Classes Display */
.classes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.class-badge {
    display: inline-block;
    background-color: var(--secondary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: 6px;
    border-left: 4px solid var(--secondary-color);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* File List */
.file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.file-item:hover {
    background-color: var(--bg-color);
}

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

.file-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.file-name {
    font-weight: 500;
    color: var(--primary-color);
}

.file-size {
    font-size: 0.875rem;
    color: var(--text-color);
}

.file-item-more {
    padding: 0.75rem;
    text-align: center;
    color: var(--text-color);
    font-style: italic;
}

.view-link {
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--secondary-color);
    border-radius: 4px;
    transition: all 0.2s;
}

.view-link:hover {
    background-color: var(--secondary-color);
    color: white;
}

.no-files {
    color: var(--text-color);
    font-style: italic;
    padding: 1rem;
    text-align: center;
}

/* Configuration Display */
.config-content {
    background-color: var(--bg-color);
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    margin: 0;
}

.config-content code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--primary-color);
}

/* Configuration Editor */
.config-editor {
    margin-top: 1rem;
}

.yaml-editor {
    width: 100%;
    min-height: 300px;
    padding: 1rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-color);
    color: var(--primary-color);
    resize: vertical;
}

.yaml-editor:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.editor-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Actions */
.actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 2rem;
}

/* Loading and Error States */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-color);
    font-size: 1.125rem;
}

.error-message {
    background-color: var(--error-color);
    color: white;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dataset-details-page {
        padding: 1rem;
    }

    .dataset-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions .btn {
        flex: 1;
    }

    .dataset-info {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}


/* ------------------------------------ */
/*         Dataset-details CSS          */
/* ------------------------------------ */

/* stats grid headline cards */
.stats-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0 2rem 0;
}

.metric-card {
    background-color: #1e1e2f;
    border: 1px solid #2f2f45;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    min-width: 180px;
    flex: 0 1 auto;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.metric-label {
    font-size: 0.8rem;
    color: #8a8fae;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
}

/* subsection wrappers */
.stats-subsection {
    margin: 2rem 0;
}

.subsection-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: #cdd0ff;
    margin-bottom: 0.5rem;
}

/* rows for splits and classes */
.split-stats-list,
.class-stats-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.split-row,
.class-row {
    background-color: #171725;
    border: 1px solid #2a2a3d;
    border-radius: 0.5rem;
    padding: 0.6rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.split-name,
.class-name {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
}

.split-value,
.class-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #9fa4ff;
}

/* empty state */
.stats-empty {
    background-color: #1e1e2f;
    border: 1px solid #2f2f45;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    color: #8a8fae;
    font-size: 0.9rem;
}


/* inline classes row inside dataset-info */
.info-item-classes .value {
    display: block;
    max-width: 100%;
}

.classes-inline-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.4rem;
}

.class-badge {
    background-color: #2a2a3d;
    border: 1px solid #3a3a5a;
    border-radius: 0.5rem;
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1rem;
    color: #fff;
    white-space: nowrap;
}

/* ------------------------------------ */
/*          DATASET VIEWER CSS          */
/* ------------------------------------ */

.viewer-section-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-primary);
}

.viewer-topbar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    margin-bottom: 0.5rem;
}

.viewer-nav-btn {
    position: absolute;
    background: var(--bg-tertiary, #21262d);
    border: 1px solid var(--border-primary, #30363d);
    border-radius: 8px;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--brand-orange, #E64100);
}

.viewer-nav-prev {
    left: 0;
}

.viewer-nav-next {
    right: 0;
}

.viewer-current-filename {
    color: var(--brand-cyan, #0AD0F8);
    font-weight: 600;
    font-size: 0.9rem;
    max-width: 60%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
}

.viewer-section-meta {
    color: var(--text-secondary, #c9d1d9);
    font-size: 0.75rem;
    text-align: center;
}
