/* ============================================================
   Detail Compact — Replica of panel_compact/detail.mustache
   Two-column: main content (accordion sections)
   + sidebar (title, image, stats, enroll).
   ============================================================ */

/* --- Wrapper --- */
.detail-compact-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 32px 48px;
}

/* --- Layout --- */
.detail-compact-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 28px;
    align-items: start;
}

/* --- Main Content (Accordion) --- */
.detail-compact-main {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* --- Accordion Sections --- */
.detail-compact-wrapper .katalog-detail-section {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.2s;
}

.detail-compact-wrapper .katalog-detail-section:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.detail-compact-wrapper .katalog-detail-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.detail-compact-wrapper .katalog-detail-section-header:hover {
    background: #f8fafc;
}

.detail-compact-wrapper .katalog-detail-section-header h2 {
    flex: 1;
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: #1e293b;
}

.detail-compact-wrapper .katalog-detail-chevron {
    transition: transform 0.3s ease;
    color: #94a3b8;
    flex-shrink: 0;
}

.detail-compact-wrapper .katalog-detail-section.is-closed .katalog-detail-chevron {
    transform: rotate(-90deg);
}

.detail-compact-wrapper .katalog-detail-section-body {
    padding: 0 20px 16px;
    animation: detailCompactSlideDown 0.2s ease-out;
}

@keyframes detailCompactSlideDown {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

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

/* --- Fields grid (inside accordion) --- */
.detail-compact-fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.detail-compact-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #cbd5e1;
    gap: 8px;
}

.detail-compact-field-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #64748b;
}

.detail-compact-field-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
    text-align: right;
}

/* --- Sidebar --- */
.detail-compact-sidebar {
    position: sticky;
    background: #fff;
    border-radius: 12px;
    padding: 24px 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
}

.detail-compact-sidebar-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    line-height: 1.25;
    overflow-wrap: break-word;
    word-break: break-word;
}

.detail-compact-sidebar>.katalog-detail-premium-badge {
    position: absolute;
    top: 0px;
    right: 10px;
    width: 50px !important;
    height: auto !important;
    max-height: 60px !important;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.detail-compact-sidebar hr {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 4px 0;
}

/* --- Stats row (participants + rating on same line) --- */
.detail-compact-stats-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
}

/* --- Shared styles --- */
.detail-compact-wrapper .katalog-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    margin-bottom: 16px;
    transition: color 0.2s;
}

.detail-compact-wrapper .katalog-detail-back:hover {
    color: #1e293b;
    text-decoration: none;
}

.detail-compact-wrapper .katalog-detail-richtext {
    font-size: 0.92rem;
    line-height: 1.7;
    color: #374151;
}

.detail-compact-wrapper .katalog-detail-richtext p {
    margin: 0 0 10px;
}

.detail-compact-wrapper .katalog-detail-richtext ul,
.detail-compact-wrapper .katalog-detail-richtext ol {
    padding-left: 20px;
    margin: 0 0 10px;
}

.detail-compact-wrapper .katalog-detail-richtext img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.detail-compact-wrapper .katalog-detail-image {
    border-radius: 10px;
    overflow: hidden;
}

.detail-compact-wrapper .katalog-detail-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 220px;
}

.detail-compact-wrapper .katalog-detail-image video {
    width: 100%;
    max-height: 220px;
    height: auto;
    display: block;
    object-fit: cover;
    border-radius: 10px;
}

.detail-compact-wrapper .katalog-detail-participants {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #64748b;
}

/* --- Sidebar Rating (tool_courserating widget) --- */
.detail-compact-wrapper .katalog-sidebar-rating {
    display: flex;
    align-items: center;
}

.detail-compact-wrapper .katalog-sidebar-rating .tool_courserating-stars .fa {
    font-size: 0.85rem;
}

.detail-compact-wrapper .katalog-sidebar-rating .course-average-value {
    font-size: 0.85rem;
    font-weight: 700;
}

.detail-compact-wrapper .katalog-sidebar-rating .course-rating-cntall {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* --- Buttons --- */
.detail-compact-wrapper .katalog-detail-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.detail-compact-wrapper .katalog-detail-btn-primary {
    background: var(--katalog-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.detail-compact-wrapper .katalog-detail-btn-primary:hover {
    background: var(--katalog-primary);
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    color: #fff;
    text-decoration: none;
}

/* --- Premium --- */
.detail-compact-wrapper .katalog-detail-premium-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 10px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    font-size: 0.85rem;
    font-weight: 500;
}

/* --- Comments Section --- */
.detail-compact-wrapper .katalog-detail-comments-section {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.detail-compact-wrapper .katalog-detail-comments-section h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 16px;
}

.detail-compact-wrapper .katalog-detail-rating-summary {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
}

.detail-compact-wrapper .katalog-detail-rating-big {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.detail-compact-wrapper .katalog-detail-rating-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1;
}

.detail-compact-wrapper .katalog-detail-rating-total {
    font-size: 0.8rem;
    color: #94a3b8;
}

.detail-compact-wrapper .katalog-detail-rating-bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
}

.detail-compact-wrapper .katalog-detail-rating-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #64748b;
}

.detail-compact-wrapper .katalog-detail-rating-bar {
    flex: 1;
    height: 7px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
}

.detail-compact-wrapper .katalog-detail-rating-bar>div {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    border-radius: 4px;
}

.detail-compact-wrapper .katalog-detail-comments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-compact-wrapper .katalog-detail-comment {
    padding: 14px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
}

.detail-compact-wrapper .katalog-detail-comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.detail-compact-wrapper .katalog-detail-comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.detail-compact-wrapper .katalog-detail-comment-header strong {
    font-size: 0.88rem;
    color: #1e293b;
}

.detail-compact-wrapper .katalog-detail-comment-date {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
}

.detail-compact-wrapper .katalog-detail-comment-body {
    font-size: 0.88rem;
    line-height: 1.5;
    color: #374151;
}

.detail-compact-wrapper .katalog-detail-btn-secondary {
    background: transparent;
    color: var(--katalog-primary);
    border: 1px solid #e2e8f0;
    padding: 10px 20px;
    font-size: 0.85rem;
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .detail-compact-layout {
        grid-template-columns: 1fr;
    }

    .detail-compact-sidebar {
        position: static;
        order: -1;
    }

    .detail-compact-wrapper {
        padding: 16px 20px 32px;
    }
}