/*
 * Attachments viewer (resources/views/filament/infolists/attachments-viewer.blade.php).
 *
 * Plain CSS on purpose: the panel uses Filament's prebuilt stylesheet (no custom
 * theme, no Vite), so utility classes Filament doesn't ship are unavailable.
 * Colors come from Filament's RGB variables so light/dark mode follow the panel.
 */

.av-count {
    font-weight: 400;
    color: rgba(var(--gray-500), 1);
}

.av-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    align-items: baseline;
}

.av-meta-name {
    font-weight: 500;
    color: rgba(var(--gray-950), 1);
    overflow-wrap: anywhere;
}

.dark .av-meta-name {
    color: #fff;
}

.av-meta-detail {
    font-size: 0.8125rem;
}

.av-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 20rem;
    max-height: 70vh;
    overflow: hidden;
    border-radius: 0.75rem;
    background: rgba(var(--gray-100), 1);
}

.dark .av-stage {
    background: rgba(var(--gray-800), 1);
}

.av-image {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.av-pdf {
    display: block;
    width: 100%;
    height: 70vh;
    border: 0;
    background: #fff;
}

.av-file {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem 1rem;
    text-align: center;
}

.av-file-icon {
    width: 3rem;
    height: 3rem;
    color: rgba(var(--gray-400), 1);
}

.av-file-name {
    font-weight: 500;
    overflow-wrap: anywhere;
}

.av-file-detail {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: rgba(var(--gray-500), 1);
}

.av-nav,
.av-overlay-close {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: 9999px;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: background-color 0.15s;
}

.av-nav:hover,
.av-overlay-close:hover {
    background: rgba(0, 0, 0, 0.75);
}

.av-nav:focus-visible,
.av-overlay-close:focus-visible,
.av-thumb:focus-visible {
    outline: 2px solid rgba(var(--primary-500), 1);
    outline-offset: 2px;
}

.av-nav {
    top: 50%;
    transform: translateY(-50%);
}

.av-nav-prev {
    left: 0.75rem;
}

.av-nav-next {
    right: 0.75rem;
}

.av-nav-icon {
    width: 1.25rem;
    height: 1.25rem;
}

.av-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
}

.av-counter {
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
    color: rgba(var(--gray-500), 1);
}

.av-toolbar-actions {
    display: flex;
    gap: 0.5rem;
}

.av-thumbs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-bottom: 0.25rem;
    overflow-x: auto;
}

.av-thumb {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4.5rem;
    height: 4.5rem;
    padding: 0;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 0.5rem;
    background: rgba(var(--gray-100), 1);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.15s, border-color 0.15s;
}

.dark .av-thumb {
    background: rgba(var(--gray-800), 1);
}

.av-thumb:hover {
    opacity: 1;
}

.av-thumb-active {
    border-color: rgba(var(--primary-500), 1);
    opacity: 1;
}

.av-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.av-thumb-type {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(var(--gray-600), 1);
}

.dark .av-thumb-type {
    color: rgba(var(--gray-300), 1);
}

.av-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem 1rem;
    color: rgba(var(--gray-500), 1);
}

.av-empty-icon {
    width: 2rem;
    height: 2rem;
}

.av-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 1rem 1rem;
    background: rgba(0, 0, 0, 0.85);
}

.av-overlay-close {
    top: 0.75rem;
    right: 0.75rem;
}

.av-overlay-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.av-overlay-pdf {
    width: 100%;
    max-width: 72rem;
    height: 100%;
    border: 0;
    background: #fff;
}
