/* =========================== */
/* IMAGES MODULE GROUPING STYLES */
/* =========================== */

:root {
    --images_group_bg: #ffffff;
    --images_group_header_bg: #f9fafb;
    --images_group_border: #e5e7eb;
    --images_group_text: #111827;
    --images_group_text_secondary: #6b7280;
    --images_group_radius: 0.5rem;
    --images_group_shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --images_group_transition: 200ms ease;
}

[data-theme="dark"] {
    --images_group_bg: #171717;
    --images_group_header_bg: #1f1f1f;
    --images_group_border: #262626;
    --images_group_text: #f5f5f5;
    --images_group_text_secondary: #a3a3a3;
}

/* Compact Group Container */
.images_group {
    background-color: var(--images_group_bg);
    border: 1px solid var(--images_group_border);
    border-radius: var(--images_group_radius);
    overflow: hidden;
    margin-bottom: 0.75rem;
    box-shadow: var(--images_group_shadow);
}

/* Group Header (Brand) - Compact */
.images_group_header {
    background-color: var(--images_group_header_bg);
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--images_group_border);
    display: flex;
    align-items: center;
}

.images_group_header_orphaned {
    background-color: #fef3c7;
    border-bottom-color: #fcd34d;
}

[data-theme="dark"] .images_group_header_orphaned {
    background-color: #78350f;
    border-bottom-color: #b45309;
}

/* Category Header - Top Level */
.images_group_category_header {
    background-color: #f3f4f6;
    padding: 0.375rem 0.75rem;
    border-bottom: 2px solid var(--images_group_border);
    display: flex;
    align-items: center;
}

[data-theme="dark"] .images_group_category_header {
    background-color: #262626;
    border-bottom-color: #404040;
}

/* Category Title - Compact */
.images_group_category_title {
    margin: 0;
    padding: 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--images_group_text_secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Group Title (Brand Name) - Compact */
.images_group_title {
    margin: 0;
    padding: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--images_group_text);
}

/* Subgroup (Article) */
.images_subgroup {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--images_group_border);
}

.images_subgroup:last-child {
    border-bottom: none;
}

/* Subgroup Header */
.images_subgroup_header {
    margin-bottom: 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--images_group_border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

/* Color Badge */
.images_subgroup_color {
    font-size: 0.7rem;
    color: #666666;
    background-color: #f0f0f0;
    padding: 0.15rem 0.35rem;
    border-radius: 0.25rem;
    white-space: nowrap;
    font-weight: 500;
}

[data-theme="dark"] .images_subgroup_color {
    color: #999999;
    background-color: #404040;
}

/* Subgroup Link */
.images_subgroup_link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all var(--images_group_transition);
}

.images_subgroup_link:hover {
    background-color: rgba(124, 58, 237, 0.05);
    padding-left: 0.25rem;
}

/* Subgroup Title (Article Name) - Compact */
.images_subgroup_title {
    margin: 0;
    padding: 0;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--images_group_text_secondary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    cursor: pointer;
}

.images_subgroup_link:hover .images_subgroup_title {
    color: #7c3aed;
}

/* Image Gallery - Use existing styles from table.css */
.images_subgroup .image_gallery {
    margin-bottom: 0;
    gap: 0.75rem;
}

.images_group > .image_gallery {
    margin: 0;
    padding: 0.5rem 0.75rem;
    gap: 0.75rem;
}

/* Image Checkbox - Inside Gallery Item */
.image_gallery_checkbox {
    position: absolute;
    bottom: 0.375rem;
    left: 0.375rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-color: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-radius: 0.25rem;
    transition: all 200ms ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.image_gallery_checkbox:hover {
    border-color: #7c3aed;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.image_gallery_checkbox:checked {
    background-color: #7c3aed;
    border-color: #7c3aed;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='white'%3E%3Cpath d='M12.207 4.793a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L6.5 9.086l4.293-4.293a1 1 0 0 1 1.414 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px;
}

.image_gallery_checkbox:checked:hover {
    background-color: #6d28d9;
    border-color: #6d28d9;
}

.image_gallery_checkbox:focus-visible {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
}

[data-theme="dark"] .image_gallery_checkbox {
    background-color: rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .image_gallery_checkbox:hover {
    background-color: rgba(0, 0, 0, 0.8);
    border-color: #a78bfa;
}

/* Image Tabs for switching between views */
.image_tabs_container {
    margin-top: 1rem;
}

.image_tabs_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--images_group_border);
    margin-bottom: 1rem;
}

.image_tabs_buttons {
    display: flex;
    gap: 0;
    flex: 1;
}

.image_tab_btn {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--images_group_text_secondary);
    background-color: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 200ms ease;
    text-align: center;
    min-width: 120px;
}

.image_tab_btn:hover {
    color: var(--images_group_text);
    background-color: rgba(124, 58, 237, 0.03);
}

.image_tab_btn.active {
    color: #7c3aed;
    border-bottom-color: #7c3aed;
}

[data-theme="dark"] .image_tab_btn {
    color: var(--images_group_text_secondary);
}

[data-theme="dark"] .image_tab_btn:hover {
    background-color: rgba(124, 58, 237, 0.08);
}

[data-theme="dark"] .image_tab_btn.active {
    color: #a78bfa;
    border-bottom-color: #a78bfa;
}

.image_tab_content {
    display: none;
    animation: fadeIn 200ms ease;
}

.image_tab_content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.image_tabs_empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--images_group_text_secondary);
    font-size: 0.875rem;
}

/* Transfer button styling - icon only */
.image_gallery_btn_transfer {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0.625rem 0.625rem;
    font-size: 1rem;
    font-weight: 500;
    background-color: #7c3aed;
    color: white;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 200ms ease;
    box-shadow: 0 2px 4px rgba(124, 58, 237, 0.2);
    flex-shrink: 0;
}

.image_gallery_btn_transfer:hover {
    background-color: #6d28d9;
    box-shadow: 0 4px 8px rgba(124, 58, 237, 0.3);
    transform: translateY(-1px);
}

.image_gallery_btn_transfer:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(124, 58, 237, 0.2);
}

.image_gallery_btn_transfer i {
    font-size: 1rem;
}

[data-theme="dark"] .image_gallery_btn_transfer {
    background-color: #a78bfa;
    color: #1f1f1f;
    box-shadow: 0 2px 4px rgba(167, 139, 250, 0.2);
}

[data-theme="dark"] .image_gallery_btn_transfer:hover {
    background-color: #c4b5fd;
    box-shadow: 0 4px 8px rgba(167, 139, 250, 0.3);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .images_group {
        margin-bottom: 0.5rem;
    }

    .images_group_category_header {
        padding: 0.3rem 0.5rem;
    }

    .images_group_category_title {
        font-size: 0.7rem;
    }

    .images_group_header {
        padding: 0.375rem 0.5rem;
    }

    .images_subgroup {
        padding: 0.375rem 0.5rem;
    }

    .images_subgroup_header {
        margin-bottom: 0.375rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .images_group_title {
        font-size: 0.875rem;
    }

    .images_subgroup_title {
        font-size: 0.75rem;
    }

    .images_subgroup_color {
        font-size: 0.65rem;
    }

    .images_subgroup .image_gallery,
    .images_group > .image_gallery {
        gap: 0.5rem;
    }
}
