/* Custom styles for ImageUploadify to match site design */

.imageuploadify-container {
    margin: 5px!important;
}

.imageuploadify .imageuploadify-images-list .imageuploadify-container button.btn-danger{
    background: #dd9304;
  color: #ffffff;
  border: 2px solid #dd9304;
}
.imageuploadify .imageuploadify-images-list .imageuploadify-container button.btn-danger:after{
    content: "\00d7"; /* This will render the 'X' */
    font-size: 20px;

}

/* Override default ImageUploadify styles */
.imageuploadify {
    min-height: unset !important;
    max-width: 100% !important;
    border: 2px dashed #dee2e6 !important;
    border-radius: 8px !important;
    background-color: #f8f9fa !important;
    padding: 0.25rem !important;
    text-align: center !important;
    transition: all 0.3s ease !important;
}

.imageuploadify:hover {
    border-color: #0d6efd !important;
    background-color: #e7f3ff !important;
}

.imageuploadify.dragover {
    border-color: #0d6efd !important;
    background-color: #e7f3ff !important;
    transform: scale(1.02) !important;
}


.imageuploadify-images-list {
    display: flex!important;
    justify-content: flex-start!important;
    align-content: flex-start!important;
    align-items: center!important;
}
.imageuploadify-message{
    display: none!important;
}
.imageuploadify-images-list i {
    display: block;
    font-size: 42px!important;
    text-align: center;
    margin-top: 0 !important;
    padding: 10px !important;
}

.imageuploadify-images-list button.btn-default {
    display: block;
    color: #3AA0FF;
    border-color: #3AA0FF;
    border-radius: 1em;
    margin: 5px auto!important;
    width: unset!important;
    max-width: 500px;
}

/* Upload area styling */
.imageuploadify .imageuploadify-message {
    color: #495057 !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
}

.imageuploadify .imageuploadify-details {
    color: #6c757d !important;
    font-size: 0.475rem !important;
}

/* Browse button styling */
.imageuploadify .imageuploadify-btn {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
    color: white !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.imageuploadify .imageuploadify-btn:hover {
    background-color: #0b5ed7 !important;
    border-color: #0a58ca !important;
    transform: translateY(-1px) !important;
}

/* File preview container */
.imageuploadify .imageuploadify-images-list {
    margin-top: 0.125rem !important;
    background-color: #ffffff !important;
    border: 1px solid #e9ecef !important;
    border-radius: 6px !important;
}

/* Individual file preview */
.imageuploadify .imageuploadify-image {
    border: 1px solid #e9ecef !important;
    border-radius: 6px !important;
    background-color: #ffffff !important;
    margin-bottom: 0.125rem !important;
    padding: 0.125rem !important;
    transition: all 0.2s ease !important;
}

.imageuploadify .imageuploadify-image:hover {
    border-color: #0d6efd !important;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.15) !important;
}

/* File preview image */
.imageuploadify .imageuploadify-image img {
    width: 60px !important;
    height: 60px !important;
    object-fit: cover !important;
    border-radius: 4px !important;
    border: 1px solid #e9ecef !important;
}

/* File details */
.imageuploadify .imageuploadify-details-name {
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    color: #212529 !important;
    margin-bottom: 0.25rem !important;
}

.imageuploadify .imageuploadify-details-size {
    font-size: 0.75rem !important;
    color: #6c757d !important;
    margin-bottom: 0.25rem !important;
}

.imageuploadify .imageuploadify-details-type {
    font-size: 0.625rem !important;
    background-color: #e9ecef !important;
    color: #495057 !important;
    padding: 0.125rem 0.375rem !important;
    border-radius: 3px !important;
    text-transform: uppercase !important;
    font-weight: 600 !important;
}

/* Progress bar */
.imageuploadify .imageuploadify-progress {
    height: 8px !important;
    border-radius: 4px !important;
    background-color: #e9ecef !important;
    margin-top: 0.5rem !important;
}

.imageuploadify .imageuploadify-progress-bar {
    background-color: #0d6efd !important;
    border-radius: 4px !important;
    transition: width 0.3s ease !important;
}

/* Delete button */
.imageuploadify .imageuploadify-delete {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
    padding: 0.25rem 0.5rem !important;
    border-radius: 4px !important;
    font-size: 0.75rem !important;
    transition: all 0.2s ease !important;
}

.imageuploadify .imageuploadify-delete:hover {
    background-color: #c82333 !important;
    border-color: #bd2130 !important;
    transform: translateY(-1px) !important;
}

/* Error messages */
.imageuploadify .imageuploadify-error {
    background-color: #f8d7da !important;
    border: 1px solid #f5c6cb !important;
    color: #721c24 !important;
    padding: 0.75rem !important;
    border-radius: 6px !important;
    margin-top: 1rem !important;
    font-size: 0.875rem !important;
}

/* Success messages */
.imageuploadify .imageuploadify-success {
    background-color: #d4edda !important;
    border: 1px solid #c3e6cb !important;
    color: #155724 !important;
    padding: 0.75rem !important;
    border-radius: 6px !important;
    margin-top: 1rem !important;
    font-size: 0.875rem !important;
}

/* File type icons */
.imageuploadify .imageuploadify-file-icon {
    width: 60px !important;
    height: 60px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: #f8f9fa !important;
    border: 1px solid #e9ecef !important;
    border-radius: 4px !important;
    font-size: 2rem !important;
}

/* File type specific colors */
.imageuploadify .file-type-pdf {
    color: #dc3545 !important;
}

.imageuploadify .file-type-doc,
.imageuploadify .file-type-docx {
    color: #0d6efd !important;
}

.imageuploadify .file-type-gpx,
.imageuploadify .file-type-kml,
.imageuploadify .file-type-kmz {
    color: #fd7e14 !important;
}

.imageuploadify .file-type-txt,
.imageuploadify .file-type-rtf {
    color: #6c757d !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .imageuploadify {
        padding: 0.125rem 0.125rem !important;
    }

    .imageuploadify .imageuploadify-message {
        font-size: 1rem !important;
    }

    .imageuploadify .imageuploadify-image {
        padding: 0.125rem !important;
    }

    .imageuploadify .imageuploadify-image img,
    .imageuploadify .imageuploadify-file-icon {
        width: 50px !important;
        height: 50px !important;
    }

}

/* Animation for new files */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.imageuploadify .imageuploadify-image.new-file {
    animation: fadeInUp 0.3s ease !important;
}

/* Loading state */
.imageuploadify .imageuploadify-image.loading {
    opacity: 0.7 !important;
}

.imageuploadify .imageuploadify-image.loading::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent) !important;
    animation: shimmer 1.5s infinite !important;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .imageuploadify {
        background-color: #343a40 !important;
        border-color: #495057 !important;
    }

    .imageuploadify:hover {
        background-color: #495057 !important;
    }

    .imageuploadify .imageuploadify-message {
        color: #f8f9fa !important;
    }

    .imageuploadify .imageuploadify-details {
        color: #adb5bd !important;
    }

    .imageuploadify .imageuploadify-images-list {
        background-color: #495057 !important;
        border-color: #6c757d !important;
    }

    .imageuploadify .imageuploadify-image {
        background-color: #495057 !important;
        border-color: #6c757d !important;
    }
}

/* ===== COMMENT ATTACHMENTS GALLERY - MINIMALIST DESIGN ===== */

.comment-attachments-gallery {
    margin-bottom: 1.5rem;
}

.attachments-header {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.attachments-header .badge {
    font-size: 0.75rem;
    border-radius: 12px;
}

/* Images Grid - Minimalist */
.attachment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-bottom: 1rem;
}

.attachment-item-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.attachment-link {
    text-decoration: none;
    display: block;
    transition: transform 0.2s ease;
}

.attachment-link:hover {
    transform: translateY(-2px);
}

.attachment-thumb {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: box-shadow 0.2s ease;
}

.attachment-thumb:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.attachment-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.attachment-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    color: white;
    font-size: 1.2rem;
}

.attachment-thumb:hover .attachment-overlay {
    opacity: 1;
}

.attachment-meta {
    margin-top: 0.25rem;
    text-align: center;
}

.attachment-name {
    font-size: 0.65rem;
    color: #6c757d;
    display: block;
    line-height: 1.1;
    max-width: 80px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Files List - Compact - Two columns */
.files-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.file-item-mini {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    min-width: 0; /* Allow flex items to shrink */
}

.file-item-mini:hover {
    background: #e9ecef;
}

.file-icon-mini {
    margin-right: 6px;
    font-size: 1rem;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.file-details-mini {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.file-name {
    font-size: 0.75rem;
    font-weight: 500;
    color: #495057;
    text-decoration: none;
    display: block;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.file-name:hover {
    color: #007bff;
    text-decoration: underline;
}

.file-size {
    font-size: 0.65rem;
    color: #6c757d;
    display: block;
    margin-top: 1px;
    white-space: nowrap;
}

.download-btn {
    color: #6c757d;
    text-decoration: none;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.download-btn:hover {
    color: #007bff;
    background: rgba(0,123,255,0.1);
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .attachment-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 6px;
    }

    .attachment-thumb {
        width: 60px;
        height: 60px;
    }

    .attachment-name {
        font-size: 0.65rem;
    }

    .file-item-mini {
        padding: 6px 8px;
    }

    .file-name {
        font-size: 0.8rem;
    }
}

/* ===== COMMENT ATTACHMENTS INLINE - FOR INDIVIDUAL COMMENTS ===== */

.comment-attachments-inline {
    border-top: 1px solid #f0f0f0;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
}

/* Inline Images Grid */
.inline-images-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0.5rem;
}

.inline-image-item {
    position: relative;
}

.inline-image-link {
    display: block;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.inline-image-link:hover {
    transform: scale(1.05);
}

.inline-image-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s ease;
}

.inline-image-thumb:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.inline-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    color: white;
    font-size: 1rem;
    border-radius: 6px;
}

.inline-image-link:hover .inline-image-overlay {
    opacity: 1;
}

/* Inline Files List */
.inline-files-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.inline-file-item {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.8rem;
    transition: background-color 0.2s ease;
}

.inline-file-item:hover {
    background: #e9ecef;
}

.inline-file-icon {
    margin-right: 6px;
    font-size: 1rem;
    width: 16px;
    text-align: center;
}

.inline-file-name {
    flex: 1;
    color: #495057;
    text-decoration: none;
    font-weight: 500;
    margin-right: 8px;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inline-file-name:hover {
    color: #007bff;
    text-decoration: underline;
}

.inline-file-size {
    color: #6c757d;
    font-size: 0.7rem;
    white-space: nowrap;
}

/* Responsive adjustments for inline attachments */
@media (max-width: 576px) {
    .inline-image-thumb {
        width: 50px;
        height: 50px;
    }

    .inline-file-item {
        padding: 3px 6px;
        font-size: 0.75rem;
    }

    .inline-file-icon {
        font-size: 0.9rem;
        width: 14px;
    }
}

/* Responsive adjustments for minimalist attachments */
@media (max-width: 576px) {
    .attachment-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 6px;
    }

    .attachment-thumb {
        width: 60px;
        height: 60px;
    }

    .attachment-name {
        font-size: 0.6rem;
        max-width: 60px;
    }

    .files-list {
        grid-template-columns: 1fr; /* Single column on mobile */
        gap: 4px;
    }

    .file-item-mini {
        padding: 4px 6px;
    }

    .file-name {
        font-size: 0.7rem;
    }

    .file-size {
        font-size: 0.6rem;
    }

    .file-icon-mini {
        font-size: 0.9rem;
        width: 14px;
        margin-right: 4px;
    }
}
