/* content_base content styles — content-item cards, image gallery, attachment
   lists, inline-edit affordances, and the bulk-action toolbar.

   Loaded globally from templates/layout/partials/styles.html (NOT via a per-page
   <link>), because most of these surfaces render through HTMX-swapped fragments
   (note/attachment lists, the gallery grid) that cannot reliably carry their own
   stylesheet link. Every selector below is content_base-namespaced, so a global
   load does not bleed into other apps.

   Colors use Bootstrap 5.3 CSS variables (theme- and dark-mode-aware) with
   fallbacks equal to the original hardcoded values, so light-mode appearance is
   unchanged when a token is absent.

   Not here, on purpose:
   - Drag-and-drop upload rules live canonically in dragdrop.css.
   - The HTMX request spinner uses HTMX's built-in .htmx-indicator handling. */

/* Content item styles */
.content-item {
    transition: box-shadow 0.2s ease;
}

.content-item:hover {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.content-item.archived {
    opacity: 0.6;
}

.content-item .content-actions {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.content-item:hover .content-actions {
    opacity: 1;
}

/* Privacy badges (rendered by the {% privacy_badge %} tag → privacy_badge.html).
   Sits on top of Bootstrap's .badge; content.css loads after core.css so these win. */
.privacy-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.25rem;
}

.privacy-badge i {
    font-size: 0.875rem;
}

.privacy-private {
    background-color: var(--bs-danger, #dc3545);
    color: var(--bs-white, #fff);
}

.privacy-entity {
    background-color: var(--bs-primary, #0d6efd);
    color: var(--bs-white, #fff);
}

.privacy-provider {
    background-color: var(--bs-success, #198754);
    color: var(--bs-white, #fff);
}

.privacy-badge:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

/* Inline edit styles */
.inline-edit-form {
    padding: 0.5rem;
    background-color: var(--bs-tertiary-bg, #f8f9fa);
    border-radius: 0.25rem;
    animation: fade-in 0.3s ease;
}

/* File type colors */
.file-icon .fa-file-pdf {
    color: var(--bs-danger, #dc3545);
}

.file-icon .fa-file-word {
    color: var(--bs-primary, #0d6efd);
}

.file-icon .fa-file-excel {
    color: var(--bs-success, #198754);
}

.file-icon .fa-file-powerpoint {
    color: var(--bs-orange, #fd7e14);
}

.file-icon .fa-file-image {
    color: var(--bs-purple, #6f42c1);
}

.file-icon .fa-file-zipper {
    color: var(--bs-secondary, #6c757d);
}

/* Responsive adjustments */
@media (width <= 576px) {
    .content-filters .row {
        margin: 0;
    }

    .content-filters .col-md-6,
    .content-filters .col-md-4,
    .content-filters .col-md-3,
    .content-filters .col-md-2 {
        padding: 0.25rem;
    }

    .content-list-wrapper .pagination {
        font-size: 0.875rem;
    }
}

/* Gallery View Styles */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.image-gallery-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 0.375rem;
    background-color: var(--bs-tertiary-bg, #f8f9fa);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.image-gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.image-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-gallery-item .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    color: var(--bs-white, #fff);
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.image-gallery-item:hover .overlay {
    opacity: 1;
}

.image-gallery-item .overlay .title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.image-gallery-item .overlay .meta {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Attachment List Styles */
.attachment-list {
    list-style: none;
    padding: 0;
}

.attachment-list-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease;
}

.attachment-list-item:hover {
    background-color: var(--bs-tertiary-bg, #f8f9fa);
    border-color: var(--bs-primary, #0d6efd);
}

.attachment-list-item .file-icon {
    font-size: 2rem;
    margin-right: 1rem;
    width: 3rem;
    text-align: center;
}

.attachment-list-item .file-info {
    flex: 1;
}

.attachment-list-item .file-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.attachment-list-item .file-meta {
    font-size: 0.875rem;
    color: var(--bs-secondary-color, #6c757d);
}

.attachment-list-item .file-actions {
    display: flex;
    gap: 0.5rem;
}

/* Inline Edit Enhancements */
.inline-edit-trigger {
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s ease;
}

.inline-edit-trigger:hover {
    background-color: var(--bs-secondary-bg, #e9ecef);
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

/* Bulk Actions Toolbar */
.bulk-actions-toolbar {
    position: sticky;
    top: 0;
    background-color: var(--bs-tertiary-bg, #f8f9fa);
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
    display: none;
    z-index: 100;
}

.bulk-actions-toolbar.active {
    display: block;
    animation: slide-down 0.3s ease;
}

@keyframes slide-down {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

.bulk-actions-toolbar .selection-info {
    font-weight: 500;
    margin-right: 1rem;
}
