/**
 * Level catalog page — filters, grid, selection cards
 * Replaces inline styles in level/index.php
 */

.catalog-page-header {
    padding: 48px 0 32px;
    text-align: center;
}

.catalog-page-header__title {
    margin: 0 0 12px;
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 700;
    color: var(--eman-purple, #6a1b9a);
}

.catalog-page-header__text {
    margin: 0 auto;
    max-width: 640px;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--eman-text-muted, #6b7280);
}

.catalog-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 18px 22px;
    margin-bottom: 28px;
    border-radius: var(--radius-lg, 12px);
    background: var(--eman-bg, #fff);
    border: 1px solid var(--eman-border-light, #e5e7eb);
    box-shadow: var(--shadow-card, 0 4px 20px rgba(15, 23, 42, 0.05));
}

.catalog-filter-bar__results {
    font-size: 0.95rem;
    color: var(--eman-text-muted, #6b7280);
}

.catalog-filter-bar__form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    flex: 1;
    justify-content: flex-end;
}

.catalog-filter-bar__search input {
    min-width: 220px;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--eman-border-light, #e5e7eb);
    border-radius: var(--radius-md, 8px);
    font-size: 0.95rem;
}

.catalog-filter-bar__sort {
    display: flex;
    align-items: center;
    gap: 8px;
}

.catalog-filter-bar__sort label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--eman-text, #111827);
    white-space: nowrap;
}

.catalog-filter-bar__sort select {
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--eman-border-light, #e5e7eb);
    border-radius: var(--radius-md, 8px);
    font-size: 0.9rem;
    background: #fff;
}

.catalog-empty-box,
.catalog-error-box {
    text-align: center;
    padding: 56px 28px;
    border-radius: var(--radius-lg, 12px);
    background: var(--eman-bg-subtle, #f8f9fc);
    border: 1px dashed var(--eman-border-light, #e5e7eb);
}

.catalog-empty-box .lucide-icon,
.catalog-error-box .lucide-icon {
    width: 48px;
    height: 48px;
    color: var(--eman-purple, #6a1b9a);
    margin-bottom: 16px;
}

.catalog-empty-box h4,
.catalog-error-box h4 {
    margin: 0 0 8px;
    font-size: 1.2rem;
    font-weight: 700;
}

.catalog-empty-box p,
.catalog-error-box p {
    margin: 0;
    color: var(--eman-text-muted, #6b7280);
    max-width: 480px;
    margin-inline: auto;
    line-height: 1.55;
}

/* Skeleton loader */
.catalog-skeleton-grid .skeleton-card {
    border-radius: var(--radius-lg, 12px);
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--eman-border-light, #e5e7eb);
}

.skeleton-card__image {
    aspect-ratio: 16 / 9;
    background: linear-gradient(90deg, #f0f0f5 25%, #e8e8ef 50%, #f0f0f5 75%);
    background-size: 200% 100%;
    animation: catalog-shimmer 1.4s infinite;
}

.skeleton-card__content {
    padding: 18px;
}

.skeleton-card__title,
.skeleton-card__meta {
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(90deg, #f0f0f5 25%, #e8e8ef 50%, #f0f0f5 75%);
    background-size: 200% 100%;
    animation: catalog-shimmer 1.4s infinite;
}

.skeleton-card__title { width: 85%; margin-bottom: 12px; height: 18px; }
.skeleton-card__meta { width: 60%; }

@keyframes catalog-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Level selection cards */
.level-select-card {
    display: block;
    height: 100%;
    border-radius: var(--radius-lg, 12px);
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--eman-border-light, #e5e7eb);
    box-shadow: var(--shadow-card, 0 4px 20px rgba(15, 23, 42, 0.06));
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    text-decoration: none;
    color: inherit;
}

.level-select-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(106, 27, 154, 0.12);
    border-color: rgba(106, 27, 154, 0.2);
}

.level-select-card__image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.level-select-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.level-select-card:hover .level-select-card__image img {
    transform: scale(1.04);
}

.level-select-card__body {
    padding: 20px;
}

.level-select-card__category {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--eman-purple, #6a1b9a);
}

.level-select-card__title {
    margin: 8px 0 0;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--eman-text, #111827);
}

.level-select-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.level-select-card__tag {
    font-size: 0.85rem;
    color: var(--eman-text-muted, #6b7280);
}

.level-select-card__count {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: var(--radius-pill, 999px);
    background: rgba(106, 27, 154, 0.08);
    color: var(--eman-purple, #6a1b9a);
    font-size: 0.8rem;
    font-weight: 700;
}

.catalog-section-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--eman-purple, #6a1b9a);
}

@media (max-width: 767px) {
    .catalog-page-header {
        padding: 32px 0 24px;
    }

    .catalog-filter-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
    }

    .catalog-filter-bar__results {
        text-align: center;
    }

    .catalog-filter-bar__form {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .catalog-filter-bar__search input {
        min-width: 100%;
        width: 100%;
    }

    .catalog-filter-bar__sort {
        width: 100%;
        justify-content: space-between;
    }

    .catalog-filter-bar__sort select {
        flex: 1;
    }

    .catalog-filter-bar__form .button {
        width: 100%;
        justify-content: center;
    }

    .eman-level-page .breadcrumbs__content {
        flex-wrap: wrap;
        gap: 4px;
    }

    .eman-level-page .catalog-section-title {
        font-size: 1.25rem;
        text-align: center;
    }
}
