/* dataset-detail.css - Detail page styles with Recommended Font Sizes */

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    gap: 1rem;
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    color: var(--primary);
    font-size: 19px; /* Recommended: 19px */
    font-weight: 600;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Back button */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--white);
    padding: 0.8rem 1.5rem;
    border-radius: 999px;
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.96rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--primary);
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: rgba(18, 67, 109, 0.05);
    color: var(--primary);
    transform: translateY(-1px);
}

/* Dataset Header */
.dataset-header {
    background: #ffffff;
    padding: 1.5rem 1.5rem 1.25rem;
    border-radius: 12px;
    border: 1px solid rgba(18, 67, 109, 0.08);
    box-shadow: none;
    margin-bottom: 1.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dataset-title {
    font-size: 32px;
    color: #1d2d2a;
    margin-bottom: 0.8rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-weight: 700;
    line-height: 1.3;
}

.dataset-meta {
    display: flex;
    gap: 1.2rem 1.8rem;
    flex-wrap: wrap;
    color: rgba(31, 41, 55, 0.72);
    font-size: 14px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Main Content - Two Columns */
.detail-content {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
}

/* LEFT SIDEBAR */
.sidebar-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.info-card {
    background: var(--white);
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid rgba(18, 67, 109, 0.08);
    box-shadow: none;
    overflow: hidden;
}

.info-card h2 {
    font-size: 15px;
    color: #1d2d2a;
    margin-bottom: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Organization Info (merged producer + publisher) */
.org-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.org-row {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.org-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.org-link {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s;
}

.org-link:hover {
    transform: translateX(5px);
}

.org-value {
    font-size: 16px; /* Recommended: 16px */
    color: var(--primary);
    font-weight: 600;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.org-position {
    font-size: 14px;
    color: #666;
    font-style: italic;
    margin-top: 0.2rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.org-company {
    font-size: 14px;
    color: #888;
    margin-top: 0.1rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* File Details */
.info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.7rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: #666;
    font-size: 16px; /* Recommended: 16px */
}

.info-value {
    color: var(--dark);
    font-weight: 600;
    font-size: 16px; /* Recommended: 16px */
    text-transform: uppercase;
}

/* Statistics */
.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.stat-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.1rem;
    background: #f8f8f6;
    border-radius: 10px;
    transition: all 0.3s;
    border: 1px solid rgba(18, 67, 109, 0.12);
}

.stat-box.stat-primary {
    background: #f3f6f5;
    border-left-color: rgba(18, 67, 109, 0.32);
}

.stat-box.stat-secondary {
    background: #f6f8fb;
    border-left-color: rgba(52, 152, 219, 0.28);
}

.stat-box:hover {
    transform: translateX(2px);
    box-shadow: none;
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.stat-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.stat-time {
    font-size: 1.1rem;
    font-weight: 600;
    color: #3498db;
    line-height: 1;
}

.stat-icon {
    font-size: 2rem;
    opacity: 0.6;
}

/* RIGHT CONTENT */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-width: 0;
}

.content-card {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(18, 67, 109, 0.08);
    box-shadow: none;
    overflow: hidden;
    max-width: 100%;
}

.content-card h2 {
    font-size: 15px;
    color: #1d2d2a;
    margin-bottom: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.description-text {
    color: var(--dark);
    line-height: 1.8;
    font-size: 16px; /* Recommended: 16px */
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* Download Section */
.download-section {
    background: #f4f2ee;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    color: #1d2d2a;
    border: 1px solid rgba(18, 67, 109, 0.08);
    box-shadow: none;
}

.download-section h2 {
    color: #1d2d2a;
    margin-bottom: 0.9rem;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.download-info {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
}

.download-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 14px;
    color: rgba(31, 41, 55, 0.8);
}

.download-btn {
    background: var(--primary);
    color: var(--white);
    padding: 0.9rem 2rem;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
}

.download-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: none;
}

/* Responsive Design */
@media (max-width: 968px) {
    .detail-content {
        grid-template-columns: 1fr;
    }
    
    .sidebar-info {
        order: 2;
    }
    
    .main-content {
        order: 1;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .dataset-title {
        font-size: 28px;
    }
    
    .dataset-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .download-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    animation: fadeInUp 0.8s;
    animation: fadeInUp 0.8s;
    animation: fadeInUp 0.8s;
    animation: fadeInUp 0.8s;
}

/* Unknown dataset or API down: message instead of an empty page */
.dataset-not-found {
    background: #ffffff;
    border: 1px solid rgba(18, 67, 109, 0.12);
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    margin: 1.5rem 0 3rem;
}

.dataset-not-found h1 {
    font-size: 1.6rem;
    color: #0f172a;
    margin-bottom: 0.75rem;
}

.dataset-not-found p {
    color: #475569;
    margin: 0 auto 1.5rem;
    max-width: 520px;
}

.dataset-not-found-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}
