#dataset_details {}

#dataset_details .loader {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.dataset-description-image {
    max-width: 900px;
    margin: auto;
}

.dataset-description-no-image {
    font-size: 20rem;
    max-width: 800px;
    margin: auto;
    margin-top: 3rem;
    width: 100%;
    display: flex;
    color: lightgray;
    border-radius: 20px;
    border: 10px solid lightgray;
    justify-content: center;
    min-height: 30vh;
}

.dataset-data-container {
    font-size: 1rem;
    position: relative;
}

/* Carousel container */
.dataset-carousel {
    position: relative;
    max-width: 900px;
    margin: 1rem auto 0 auto;
}

.dataset-carousel .carousel-viewport {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #f9fafb;
}

.dataset-carousel .carousel-slide {
    display: none;
    width: 100%;
    height: 100%;
}

.dataset-carousel .carousel-slide.active {
    display: block;
}

.dataset-carousel .carousel-slide img {
    display: block;
    width: 100%;
    height: auto;
}

/* Controls */
.dataset-carousel .carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: background 0.2s ease, transform 0.1s ease;
    color: #374151;
}

.dataset-carousel .carousel-control:hover {
    background: #ffffff;
}

.dataset-carousel .carousel-control:active {
    transform: translateY(-50%) scale(0.98);
}

.dataset-carousel .carousel-control.prev {
    left: 10px;
}

.dataset-carousel .carousel-control.next {
    right: 10px;
}

.dataset-carousel .carousel-control i {
    font-size: 1rem;
}

/* Indicators */
.dataset-carousel .carousel-indicators {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
}

.dataset-carousel .carousel-indicator {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #d1d5db;
    border: none;
    padding: 0;
    cursor: pointer;
}

.dataset-carousel .carousel-indicator.active {
    background: #111827;
}

.dataset-description-back-button {
    position: sticky;
    top: var(--ms-navbar-height);
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    margin-bottom: 5rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
    z-index: 20;
}

/* Markdown-like preview styling */
.markdown-preview {
    margin: 0 auto;
    padding: 3rem;
    padding-top: 1rem;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

/* Dataset header with title and share button */
.dataset-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin: 3rem 0 8px 0;
}

.markdown-preview .dataset-title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
    flex: 1;
}

/* Share button styling */
.share-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f3f4f6;
    border: none;
    border-radius: 6px;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.share-button:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
    color: #111827;
}

.share-button:active {
    background: #d1d5db;
    transform: translateY(1px);
}

.share-button i {
    font-size: 0.875rem;
}

.markdown-preview .dataset-subtitle {
    color: #4b5563;
    margin-bottom: 16px;
}

.markdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 16px 0 24px 0;
}

.markdown-section {
    margin-bottom: 24px;
}

.markdown-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 12px 0;
}

.markdown-body p {
    margin: 0 0 12px 0;
    line-height: 1.6;
}

/* Key-Value table styling */
.kv-table {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.kv-row {
    display: grid;
    grid-template-columns: 220px 1fr;
    border-top: 1px solid #e5e7eb;
}

.kv-row:first-child {
    border-top: none;
}

.kv-key {
    background: #f9fafb;
    color: #374151;
    font-weight: 600;
    padding: 10px 12px;
    border-right: 1px solid #e5e7eb;
}

.kv-value {
    padding: 10px 12px;
    color: #111827;
    word-break: break-word;
}

/* Auth banner */
.dataset-auth-banner {
    padding: 10px 12px;
    background: #fffbeb;
    color: #92400e;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
}

.dataset-auth-banner .fa-circle-exclamation {
    font-size: 2rem;
}

/* Copy notification */
.copy-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 1100;
    animation: slideIn 0.3s ease-out;
}

.copy-notification i {
    font-size: 1rem;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    .dataset-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .share-button {
        align-self: flex-start;
    }

    .kv-row {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
    }

    .kv-key {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
}

/* New: metadata blocks and markdown tables */
.metadata-block {
    margin-bottom: 20px;
}

.metadata-subblock {
    margin: 8px 0 12px 0;
}

.metadata-block h3 {
    font-size: 1.1rem;
    margin: 0 0 8px 0;
}

.metadata-subblock h4 {
    font-size: 1rem;
    margin: 0 0 6px 0;
}

.md-table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0 12px 0;
    font-size: 0.9em;
}

.md-table thead th {
    background: #f9fafb;
    color: #374151;
    font-weight: 600;
    border: 1px solid #e5e7eb;
    padding: 8px 10px;
    text-align: left;
}

.md-table tbody td {
    border: 1px solid #e5e7eb;
    padding: 8px 10px;
    vertical-align: top;
}

.md-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.markdown-body a {
    color: #2563eb;
    text-decoration: underline;
}

.markdown-body strong {
    font-weight: 600;
}