/* --- GLOBAL ATTACHMENT VIEWER STYLES --- */
#globalAttachmentViewer {
    z-index: 1060 !important;
}

#globalAttachmentViewer .modal-dialog {
    max-width: 90vw;
    max-height: 90vh;
}

#globalAttachmentViewer .modal-body {
    padding: 0;
    height: 70vh;
    min-height: 400px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Glide.js Carousel Styles */
#globalImageCarousel {
    height: 100%;
    min-height: 400px;
    position: relative;
    flex: 1;
}

#globalCarouselImages {
    height: 100%;
    min-height: 400px;
    flex: 1;
}

.glide__slides {
    height: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

                 .glide__slide {
                     height: 100%;
                     min-height: 400px;
                     display: flex;
                     align-items: center;
                     justify-content: center;
                     margin: 0;
                     padding: 0;
                 }

/* Custom Glide.js Arrow Overrides */
.glide__arrow {
    background: rgba(0, 0, 0, 0.8) !important;
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
    border-radius: 50% !important;
    width: 50px !important;
    height: 50px !important;
    font-size: 24px !important;
    font-weight: bold !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Hide arrows when not needed */
.glide__arrows[style*="display: none"],
.glide__arrows[style*="visibility: hidden"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.glide__arrow:hover {
    background: rgba(0, 0, 0, 0.9) !important;
    border-color: white !important;
}

.glide__arrow--left {
    left: 20px !important;
}

.glide__arrow--right {
    right: 20px !important;
}

/* Ensure arrows are always visible */
.glide__arrows {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Attachment content styles */
                 .attachment-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    cursor: zoom-in;
    user-select: none;
}

.attachment-img:hover {
    cursor: zoom-in;
}

.attachment-img.zoomed {
    cursor: grab;
}

.attachment-img.zoomed:active {
    cursor: grabbing;
}

.attachment-pdf {
    width: 100%;
    height: 100%;
    border: none;
    background: var(--light-color, #f8f9fa);
}

.attachment-video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.attachment-audio {
    max-width: 100%;
    margin: 2rem auto;
}

.attachment-unsupported {
    padding: 2rem;
    background: var(--light-color, #f8f9fa);
    border-radius: 8px;
    margin: 2rem;
}

.attachment-unsupported i {
    font-size: 4rem;
    color: var(--muted, #6c757d);
}

/* Footer layout */
.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
    gap: 1rem;
}

/* Image controls layout */
.image-controls-container {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
    flex: 1;
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.control-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted, #6c757d);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

/* Consistent button sizing */
.image-controls-container .btn {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.image-controls-container .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.image-controls-container .btn:active {
    transform: translateY(0);
}

/* Action buttons */
.action-buttons {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    flex-shrink: 0;
}

.action-buttons .btn {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.action-buttons .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.action-buttons .btn:active {
    transform: translateY(0);
}

/* Counter badge */
#attachmentCounter {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Image info badge */
#imageInfo {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background: linear-gradient(135deg, var(--info-color, #17a2b8) 0%, var(--info-dark, #138496) 100%) !important;
    border: none;
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.2);
}

#imageInfo span {
    margin: 0 0.25rem;
}

/* Hidden controls */
.attachment-counter-hidden,
.attachment-controls-hidden {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #globalAttachmentViewer .modal-dialog {
        max-width: 95vw;
        margin: 0.5rem auto;
    }
    
    #globalAttachmentViewer .modal-body {
        height: 60vh;
    }
    
    .footer-content {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .image-controls-container {
        gap: 1rem;
        justify-content: center;
    }
    
    .control-group {
        gap: 0.25rem;
    }
    
    .image-controls-container .btn {
        width: 36px;
        height: 36px;
        font-size: 0.875rem;
    }
    
    .control-label {
        font-size: 0.7rem;
    }
    
    .action-buttons {
        gap: 1rem;
        justify-content: center;
    }
}

/* Keyboard shortcuts hint */
.keyboard-shortcuts {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    z-index: 1000;
    display: none;
}

#globalAttachmentViewer:hover .keyboard-shortcuts {
    display: block;
}
