/**
 * Worksheets page - layout overrides
 * Wider page, wider sidebar, same card size as colouring pages/books
 */

/* Card section width */
.worksheet-categories .container {
    max-width: 1300px;
    padding: 0 24px;
}

/* Wider left sidebar for collapsible sections + 19 subcategories */
.worksheet-categories .categories-sidebar {
    width: 300px;
    min-width: 300px;
}

/* Collapsible section header */
.worksheet-categories .category-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #374151;
    font-size: 0.8rem;
    font-weight: 600;
    background: #f8fafc;
    margin-bottom: 0.25rem;
    user-select: none;
}

.worksheet-categories .category-section-header:hover {
    background: #f1f5f9;
}

.worksheet-categories .category-section-header i.fa-chevron-down,
.worksheet-categories .category-section-header i.fa-chevron-right {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.worksheet-categories .category-section-header.collapsed .category-section-count {
    margin-left: auto;
}

/* Chevron rotates when section is collapsed */
.worksheet-categories .category-section-header.collapsed .fa-chevron-down {
    transform: rotate(-90deg);
}

.worksheet-categories .category-section-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-left: 0.5rem;
    margin-bottom: 0.5rem;
}

.worksheet-categories .category-section-content.collapsed {
    display: none;
}

/* Subcategory items - indent under section */
.worksheet-categories .category-section-content .category-list-item {
    padding-left: 1rem;
}

/* Responsive - sidebar widths */
@media (max-width: 1400px) {
    .worksheet-categories .container {
        max-width: 1300px;
    }
    .worksheet-categories .categories-sidebar {
        width: 280px;
        min-width: 280px;
    }
}

@media (max-width: 1200px) {
    .worksheet-categories .container {
        max-width: 100%;
    }
    .worksheet-categories .categories-sidebar {
        width: 260px;
        min-width: 260px;
    }
}

@media (max-width: 992px) {
    .worksheet-categories .categories-sidebar {
        width: 240px;
        min-width: 240px;
    }
}

@media (max-width: 768px) {
    .worksheet-categories .categories-sidebar {
        width: 100%;
        min-width: auto;
        max-height: 320px;
    }
}

/* Card size - match storybooks: fixed height, compact grid */
.worksheet-categories .thumbnails-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.worksheet-categories .colouring-card,
.worksheet-categories .card-preview,
.worksheet-categories .preview-image,
.worksheet-categories .card-image {
    height: 396px;
    min-height: 396px;
}

.worksheet-categories .card-image {
    object-fit: cover;
    object-position: center;
}

/* New badge - same style as storybooks (rotated ribbon) */
.worksheet-categories .new-badge {
    position: absolute;
    top: 8px;
    right: -42px;
    left: auto;
    width: 140px;
    text-align: center;
    border-radius: 0;
    transform: rotate(40deg);
    padding: 4px 10px;
    background: rgba(239, 68, 68, 0.7);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 5;
}

/* Age badge - above card-actions layer */
.worksheet-categories .card-age {
    position: absolute;
    bottom: 12px;
    right: -42px;
    left: auto;
    width: 140px;
    text-align: center;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.95);
    color: #111827;
    padding: 4px 10px;
    border-radius: 0;
    transform: rotate(-40deg);
    z-index: 20;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Hide binocular overlay on hover - we have View button */
.worksheet-categories .card-overlay {
    display: none !important;
}
