/* ========================================
   HIGH QUALITY IMAGE DISPLAY CSS
   ======================================== */

/* Main Image Container - High Quality Display */
.main-image-container {
    position: relative;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.main-image-container:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.main-image-container .article-image-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.main-image-container img {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.main-image-container:hover img {
    transform: scale(1.02);
}

/* Smooth image transition during change */
.main-image-container img.changing {
    transition: opacity 0.15s ease;
}

/* Zoom Icon Overlay */
.zoom-icon {
    opacity: 0;
    transition: opacity 0.3s ease;
    background: rgba(0,0,0,0.6);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image-container:hover .zoom-icon {
    opacity: 1;
}

/* Gallery Badge */
.gallery-badge {
    backdrop-filter: blur(5px);
    border-radius: 8px;
}

.gallery-badge .badge {
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

/* Responsive Image Component Styles */
.article-image-container {
    position: relative;
    overflow: hidden;
}

.article-image-container:hover .image-overlay {
    opacity: 1;
}

.image-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-zoom-btn {
    backdrop-filter: blur(5px);
    background-color: rgba(255, 255, 255, 0.8) ;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-zoom-btn:hover {
    background-color: rgba(255, 255, 255, 0.95) ;
    transform: scale(1.1);
}

/* Improve modal backdrop */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
}

/* Loading placeholder */
.article-image-container img {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.article-image-container img[src] {
    animation: none;
    background: none;
}

/* Thumbnail Carousel Improvements */
.thumbnail-carousel-container {
    position: relative;
}

.thumbnail-image {
    width: 100px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    border: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.thumbnail-image:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    border-color: rgba(0,123,255,0.5);
    z-index: 10;
}

.thumbnail-image:hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        rgba(0,123,255,0.1) 0%,
        rgba(0,123,255,0.2) 50%,
        rgba(0,123,255,0.1) 100%
    );
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.thumbnail-image.active {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.3);
    transform: translateY(-1px);
}

.thumbnail-image.active:hover {
    transform: translateY(-3px) scale(1.05);
}

/* Preview mode styling */
.thumbnail-image.preview-mode {
    border-color: rgba(255,193,7,0.8);
    box-shadow: 0 0 0 2px rgba(255,193,7,0.4), 0 4px 15px rgba(255,193,7,0.3);
    transform: translateY(-2px) scale(1.02);
}

/* Main image preview states */
.main-image-container img.changing {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.main-image-container img.preview-mode {
    opacity: 0.95;
    filter: brightness(1.05) contrast(1.02);
}

/* Article Gallery Component */
.article-gallery {
    margin: 2rem 0;
}

.gallery-title {
    color: #2c3e50;
    font-weight: 600;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.gallery-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.gallery-image {
    aspect-ratio: 4/3;
    object-fit: cover;
    cursor: pointer;
}

/* Hide extra images initially if more than 6 */
.gallery-item:nth-child(n+7) {
    display: none;
}

.gallery-item.show {
    display: block ;
}

/* Loading animation */
.gallery-item img {
    transition: opacity 0.3s ease;
}

.gallery-item img[loading="lazy"] {
    opacity: 0;
}

.gallery-item img[loading="lazy"].loaded {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-image-container img {
        max-height: 400px;
    }

    .zoom-icon {
        width: 40px;
        height: 40px;
    }

    .zoom-icon i {
        font-size: 1rem;
    }

    .gallery-badge .badge {
        font-size: 0.8rem;
    }

    .thumbnail-image {
        width: 80px;
        height: 60px;
    }

    .gallery-item {
        margin-bottom: 1rem;
    }

    .gallery-title {
        font-size: 1.1rem;
    }
}

/* =====================================================
   Article Create/Edit Responsive Layout Enhancements
   ===================================================== */
.article-editor-layout { align-items: flex-start; }

/* Ensure main editor card stretches and editors don't overflow on narrow screens */
.article-editor-layout .main-editor-column .card { width:100%; }
.article-editor-layout .main-editor-column { min-width:0; }
.article-editor-layout .main-editor-column .text-editor-component { max-width:100%; }
.article-editor-layout .main-editor-column .text-editor-toolbar { flex-wrap: wrap; }
.article-editor-layout .main-editor-column .text-editor-area { overflow-wrap: break-word; }
.article-editor-layout .article-section-body { padding:1.25rem 1.25rem 1rem; }
.article-editor-layout .basic-info-body { background: #fff; }
.article-editor-layout .long-description-body { background:#fff; }

@media (max-width:767.98px){
    .article-editor-layout .basic-info-body { min-height: 100%; }
    .article-editor-layout .long-description-body { min-height: 100%; }
}
.article-editor-layout .long-description-card { width:100%; }
@media (max-width:575.98px){
    .article-editor-layout .long-description-card .card-header .card-title { font-size:0.95rem; }
}

@media (max-width: 767.98px) {
    .article-editor-layout .main-editor-column .text-editor-component { padding:0.25rem 0.4rem 0.6rem; }
    .article-editor-layout .main-editor-column .text-editor-toolbar { gap:0.25rem; }
    .article-editor-layout .main-editor-column .text-editor-area { min-height:160px; }
}

@media (max-width:575.98px){
    .article-editor-layout .main-editor-column .card-body { padding-bottom:0.9rem; }
    .article-editor-layout .main-editor-column .text-editor-area { font-size:0.85rem; }
    .article-editor-layout .main-editor-column .text-editor-toolbar button { padding:0.25rem 0.4rem; font-size:0.7rem; }
}

@media (max-width: 991.98px) {
    /* Rely on Bootstrap order utility classes instead of column-reverse to avoid overlay issues */
    .article-editor-layout { flex-direction: row; flex-wrap: wrap; }
    .article-editor-layout > [class*='col-lg-8'],
    .article-editor-layout > [class*='col-lg-4'] { width: 100%; }
    .side-panels-column { margin-bottom: 1.25rem; }
    .article-editor-layout .card { margin-bottom: 1.1rem; }
}

@media (max-width: 767.98px) {
    .article-editor-layout { row-gap: 1.75rem; }
    .article-editor-layout .card { box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
    .article-editor-layout .card-header { padding: 0.65rem 0.9rem; }
    .article-editor-layout .card-header .card-title { font-size: 0.95rem; }
    .article-editor-layout .form-label { font-size: 0.8rem; margin-bottom: 0.25rem; }
    .article-editor-layout input.form-control,
    .article-editor-layout select.form-select { font-size: 0.85rem; padding: 0.45rem 0.65rem; }
    .featured-upload-area, .featured-video-upload-area, .gallery-upload-area { padding: 1.2rem 0.75rem ; }
    .featured-upload-area .display-6, .featured-video-upload-area .display-6 { font-size: 2.1rem; }
    #image-gallery-files-list .col-6, #video-gallery-files-list .col-6 { padding: 0.4rem; }
    .gallery-preview .row { margin-left: -0.4rem; margin-right: -0.4rem; }
}

@media (max-width: 575.98px) {
    .article-editor-layout h1 { font-size: 1.35rem; }
    .article-editor-layout .alert { padding: 0.75rem 0.85rem; font-size: 0.75rem; }
    .article-editor-layout .alert .fs-4 { font-size: 1.3rem ; }
    .article-editor-layout .small, .article-editor-layout small { font-size: 0.7rem ; }
    .article-editor-layout .btn { padding: 0.45rem 0.85rem; font-size: 0.78rem; }
    .article-editor-layout .btn-lg { padding: 0.65rem 1rem; font-size: 0.85rem; }
    .article-editor-layout .gallery-upload-area p { font-size: 0.75rem; }
    .article-editor-layout .gallery-upload-area small { font-size: 0.65rem; }
    /* Overlap guards */
    .article-editor-layout .col-lg-8,
    .article-editor-layout .col-lg-4 { display:block; width:100%; max-width:100%; }
    .article-editor-layout .card { position:relative; z-index:1; }
    .article-editor-layout .card + .card { margin-top:1rem; }
    .article-editor-layout .side-panels-column .card { margin-bottom:1rem; }
    .article-editor-layout .featured-upload-area,
    .article-editor-layout .featured-video-upload-area,
    .article-editor-layout .gallery-upload-area { min-height:120px; }
}

/* Improve drag/drop visual clarity on mobile */
@media (hover: none) and (pointer: coarse) {
    .featured-upload-area, .featured-video-upload-area, .gallery-upload-area {
        border-style: solid;
    }
}

/* Tighten spacing for stacked panels */
@media (max-width: 420px) {
    .article-editor-layout .card-body { padding: 0.9rem 0.85rem; }
    .article-editor-layout .mb-3 { margin-bottom: 0.85rem ; }
    /* Extra tight stacking fix */
    .article-editor-layout .card { margin-bottom:0.9rem; }
    .article-editor-layout .side-panels-column .card:last-child { margin-bottom:1.1rem; }
}

/* Article Image Upload Styles */

/* Featured Image Container */
.featured-image-container {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
    background: #fafafa;
    position: relative;
}

.featured-image-container.drag-over {
    border-color: #007bff;
    background: #e3f2fd;
    transform: scale(1.02);
}

.featured-image-container.has-featured .featured-upload-area {
    display: none;
}

/* Featured Upload Area */
.featured-upload-area {
    text-align: center;
    padding: 2rem 1rem;
}

.featured-upload-icon {
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.featured-upload-icon i {
    font-size: 3rem;
}

.featured-upload-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.featured-upload-hint {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 1.5rem;
}

.featured-upload-btn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.95rem;
}

.featured-upload-btn:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.3);
}

.featured-file-input {
    display: none;
}

/* Featured Preview */
.featured-preview {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.featured-preview-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    max-width: 300px;
    margin: 0 auto;
}

.featured-preview-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.featured-preview-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
    border-radius: 8px 8px 0 0;
}

.featured-preview-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.featured-preview-overlay:hover {
    background: #dc3545;
    transform: scale(1.1);
}

.featured-preview-info {
    padding: 0.5rem 0.75rem;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.featured-preview-name {
    font-weight: 600;
    color: #495057;
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.featured-preview-size {
    font-size: 0.7rem;
    color: #6c757d;
}

/* Gallery Styles */
.image-gallery-container {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
    background: #fafafa;
    position: relative;
}

.image-gallery-container.drag-over {
    border-color: #007bff;
    background: #e3f2fd;
    transform: scale(1.02);
}

.gallery-upload-area {
    text-align: center;
    padding: 2rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-upload-area:hover {
    background-color: #f8f9fa;
    border-color: #007bff;
    transform: translateY(-2px);
}

.gallery-upload-icon {
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.gallery-upload-icon i {
    opacity: 0.7;
}

.gallery-upload-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.gallery-upload-hint {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 1.5rem;
}

.gallery-upload-btn {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.gallery-upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3);
}

.gallery-file-input {
    display: none;
}

/* Gallery Preview - Updated to work with existing HTML structure */
.gallery-preview {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #dee2e6;
    display: none;
}

.gallery-preview.has-images {
    display: block;
}

.article-upload-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.8rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
}

.article-upload-gallery-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #176B82;
    border: 1px solid #e9ecef;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    display: block;
    aspect-ratio: 4 / 3;
    min-width: 0;
}

.article-upload-gallery-item:hover {
    border-color: #007bff;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.2);
}

.article-upload-gallery-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: all 0.3s ease;
    border-radius: 0;
    z-index: 1;
}

.article-upload-gallery-item:hover .article-upload-gallery-image {
    transform: scale(1.05);
}


.article-upload-gallery-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(220, 53, 69, 0.95);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
    z-index: 20;
}

.article-upload-gallery-item:hover .article-upload-gallery-overlay {
    opacity: 1;
    transform: scale(1.05);
}

.article-upload-gallery-overlay:hover {
    background: #dc3545;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.article-upload-gallery-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.6rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.6) 70%, transparent 100%);
    color: white;
    backdrop-filter: blur(2px);
    border-radius: 0 0 10px 10px;
    z-index: 15;
}

.article-upload-gallery-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
/* Simplified gallery item variant (no overlay / title) */
.article-upload-gallery-item.simple .article-upload-gallery-info,
.article-upload-gallery-item.simple .article-upload-gallery-overlay {
    display: none ;
}
.article-upload-gallery-item.simple .gallery-remove-btn {
    opacity: 0.9;
    transition: background .2s ease, transform .2s ease;
}
.article-upload-gallery-item.simple .gallery-remove-btn:hover {
    background: rgba(0,0,0,0.8) ;
    transform: scale(1.05);
}

.article-upload-gallery-size {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    display: inline-block;
    width: fit-content;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
}

/* Current/Existing Image Sections */
.current-image-section,
.existing-gallery-section {
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 1rem;
    margin-top: 1rem;
}

.current-image-section h6,
.existing-gallery-section h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.current-image-section .position-relative img,
.existing-gallery-section .position-relative img {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Upload Progress */
.gallery-upload-progress {
    margin-top: 1rem;
    display: none;
}

.gallery-upload-progress.show {
    display: block;
}

.gallery-progress-bar {
    background: #e9ecef;
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.gallery-progress-fill {
    background: linear-gradient(90deg, #28a745, #20c997);
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Custom Form Styles for Articles */
.custom-form-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.custom-section-title {
    color: #495057;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.custom-section-title i {
    color: #007bff;
}

.custom-form-group {
    margin-bottom: 1rem;
}

.custom-form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    display: block;
}

.custom-location-helper-text {
    color: #6c757d;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: block;
}

.custom-error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Responsive Design - Updated for New Classes */
@media (max-width: 768px) {
    .article-upload-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.6rem;
        padding: 0.25rem;
    }

    .new-video-gallery-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.75rem;
        padding: 0.25rem;
    }

    .article-upload-gallery-item {
        aspect-ratio: 4 / 3;
    }

    .new-video-gallery-preview-item {
        height: 160px;
    }

    .new-video-gallery-preview-video {
        height: 100px;
    }

    .new-gallery-preview-info,
    .article-video-gallery-preview-info {
        padding: 0.5rem;
        min-height: 70px;
    }

    /* Gallery preview responsive adjustments */
    .gallery-preview .position-relative {
        height: 120px;
        min-width: 240px;
    }

    .gallery-preview img,
    .gallery-preview video {
        width: 100px;
    }

    .gallery-preview .position-relative .file-info {
        padding: 0.5rem;
        gap: 0.25rem;
    }

    .featured-upload-area,
    .gallery-upload-area {
        padding: 1.5rem 1rem;
    }

    .featured-upload-icon,
    .gallery-upload-icon {
        font-size: 2.5rem;
    }

    .featured-upload-text,
    .gallery-upload-text {
        font-size: 1rem;
    }

    .featured-preview-image {
        height: 100px;
    }

    .featured-video-preview-item {
        max-width: 300px;
    }

    .lightbox-close {
        top: 10px;
        right: 15px;
        font-size: 30px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 576px) {
    .custom-form-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    .article-upload-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        padding: 0.25rem;
    }

    .new-video-gallery-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.5rem;
        padding: 0.25rem;
    }

    .article-upload-gallery-item {
        aspect-ratio: 4 / 3;
    }

    .new-video-gallery-preview-item {
        height: 140px;
    }

    .new-video-gallery-preview-video {
        height: 90px;
    }

    .article-video-gallery-preview-info {
        padding: 0.3rem;
        min-height: 50px;
    }

    .article-upload-gallery-name {
        font-size: 0.75rem;
        margin-bottom: 0.1rem;
    }

    .article-upload-gallery-size {
        font-size: 0.65rem;
        padding: 0.15rem 0.3rem;
    }

    .article-video-gallery-preview-name {
        font-size: 0.75rem;
        margin-bottom: 0.1rem;
    }

    .article-video-gallery-preview-size {
        font-size: 0.65rem;
        padding: 0.15rem 0.3rem;
    }

    .article-upload-gallery-overlay {
    /* Simplified video preview variant */
    .article-video-gallery-preview-item.simple .article-video-gallery-preview-info,
    .article-video-gallery-preview-item.simple .article-video-gallery-preview-overlay { display:none ; }
    .article-video-gallery-preview-item.simple .video-remove-btn { opacity:.9; transition:background .2s ease, transform .2s ease; }
    .article-video-gallery-preview-item.simple .video-remove-btn:hover { background:rgba(0,0,0,.8); transform:scale(1.05); }

    /* Action card body (previously generic .card-body) */
    .article-actions-card-body { padding:1rem 1.1rem; background:#fff; }
    @media (max-width: 576px) {
        .article-actions-card-body .d-flex.gap-2 { flex-wrap:wrap; width:100%; }
        .article-actions-card-body button.btn { flex:1 1 100%; width:100%; justify-content:center; }
        .article-actions-card-body .d-flex.gap-3 { flex-direction:column; align-items:stretch ; }
        .article-actions-card-body h6 { font-size:0.9rem; }
        .article-actions-card-body small { font-size:0.7rem; }
    }

    /* Video caption refinement */
    .article-video-gallery-preview-item .video-caption { font-family:inherit; }
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
        top: 6px;
        right: 6px;
    }

    /* Gallery preview mobile adjustments */
    .gallery-preview .position-relative {
        height: 100px;
        min-width: 100%;
        flex-direction: column;
    }

    .gallery-preview img,
    .gallery-preview video {
        width: 100%;
        height: 60px;
        border-radius: 8px 8px 0 0;
    }

    .gallery-preview .position-relative .file-info {
        border-left: none;
        border-top: 1px solid #e9ecef;
        padding: 0.4rem;
    }

    .featured-upload-btn,
    .gallery-upload-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .featured-video-preview-item {
        max-width: 280px;
    }

    .lightbox-close {
        top: 5px;
        right: 10px;
        font-size: 24px;
        width: 35px;
        height: 35px;
    }
}

/* ===================================================================
   VIDEO UPLOAD STYLES - Similar to Image Upload
   =================================================================== */

/* Featured Video Container */
.featured-video-container {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
    background: #fafafa;
    position: relative;
}

.featured-video-container.drag-over {
    border-color: #28a745;
    background: #e8f5e8;
    transform: scale(1.02);
}

.featured-video-container.has-featured .featured-video-upload-area {
    display: none;
}

/* Featured Video Upload Area */
.featured-video-upload-area {
    text-align: center;
    padding: 2rem 1rem;
}

.featured-video-upload-icon {
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.featured-video-upload-icon i {
    font-size: 3rem;
}

.featured-video-upload-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.featured-video-upload-hint {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 1.5rem;
}

.featured-video-upload-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.95rem;
}

.featured-video-upload-btn:hover {
    background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3);
}

.featured-video-file-input {
    display: none;
}

/* Featured Video Preview */
.featured-video-preview {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.featured-video-preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    max-width: 350px;
    margin: 0 auto;
}

.featured-video-preview-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.featured-preview-video {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
    border-radius: 8px 8px 0 0;
    background: #000;
}

.featured-video-preview-video {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
    border-radius: 8px 8px 0 0;
    background: #000;
}

.featured-video-preview-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.featured-video-preview-overlay:hover {
    background: #dc3545;
    transform: scale(1.1);
}

.featured-video-preview-info {
    padding: 0.4rem 0.6rem;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.featured-video-preview-name {
    font-weight: 600;
    color: #495057;
    font-size: 0.75rem;
    margin-bottom: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.featured-video-preview-size {
    font-size: 0.65rem;
    color: #6c757d;
}

.admin-approval-notice {
    font-size: 0.65rem;
    margin-top: 0.25rem;
    padding: 0.2rem 0.4rem;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 3px;
    color: #856404;
}

/* Video Gallery Styles */
.video-gallery-container {
    border: 2px dashed #ddd;
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
    background: #fafafa;
    position: relative;
}

.video-gallery-container.drag-over {
    border-color: #28a745;
    background: #e8f5e8;
    transform: scale(1.02);
}

.video-gallery-upload-area {
    text-align: center;
    padding: 2rem 1rem;
}

.video-gallery-upload-icon {
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.video-gallery-upload-icon i {
    opacity: 0.7;
}

.video-gallery-upload-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.video-gallery-upload-hint {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 1.5rem;
}

.video-gallery-upload-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.video-gallery-upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3);
}

.video-gallery-file-input {
    display: none;
}

/* Video Gallery Preview - New Classes to Avoid Conflicts */
/* Article Video Gallery Preview Styles */
.article-video-gallery-preview {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #dee2e6;
    display: none;
}

.article-video-gallery-preview.has-videos {
    display: block;
}

.article-video-gallery-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
}

.article-video-gallery-preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e9ecef;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    min-height: 150px;
    max-height: 150px;
    min-width: 250px;
    max-width: 250px;
}

.article-video-gallery-preview-item:hover {
    border-color: #28a745;
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.15);
}

.article-video-gallery-preview-video {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
    background: linear-gradient(45deg, #000 25%, #333 25%),
                linear-gradient(-45deg, #000 25%, #333 25%),
                linear-gradient(45deg, #333 75%, #000 75%),
                linear-gradient(-45deg, #333 75%, #000 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    transition: all 0.3s ease;
    border-radius: 8px 8px 0 0;
}

.article-video-gallery-preview-item:hover .article-video-gallery-preview-video {
    transform: scale(1.05);
}

.article-video-gallery-preview-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(220, 53, 69, 0.95);
    color: white;
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.article-video-gallery-preview-item:hover .article-video-gallery-preview-overlay {
    opacity: 1;
    transform: scale(1.05);
}

.article-video-gallery-preview-overlay:hover {
    background: #dc3545;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.article-video-gallery-preview-info {
    padding: 0.75rem;
    background: linear-gradient(to bottom, #fff 0%, #f8f9fa 100%);
    border-top: 1px solid #e9ecef;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 80px;
}

.article-video-gallery-preview-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.article-video-gallery-preview-size {
    font-size: 0.7rem;
    color: #6c757d;
    font-weight: 500;
    background: rgba(108, 117, 125, 0.12);
    padding: 0.2rem 0.4rem;
    border-radius: 8px;
    display: inline-block;
    width: fit-content;
    border: 1px solid rgba(108, 117, 125, 0.15);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Current/Existing Video Sections */
.current-video-section,
.existing-video-gallery-section {
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 1rem;
    margin-top: 1rem;
}

.current-video-section h6,
.existing-video-gallery-section h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.current-video-section .position-relative video,
.existing-video-gallery-section .position-relative video {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: #000;
}

/* Video Upload Progress */
.video-gallery-upload-progress {
    margin-top: 1rem;
    display: none;
}

.video-gallery-upload-progress.show {
    display: block;
}

.video-progress-bar {
    background: #e9ecef;
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.video-progress-fill {
    background: linear-gradient(90deg, #28a745, #20c997);
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

/* Video File Type Indicators */
.video-type-indicator {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
}

/* Video Play Overlay */
.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.gallery-preview .position-relative:hover .video-play-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

/* Status Indicators */
.gallery-preview .status-indicator {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    backdrop-filter: blur(4px);
}

.gallery-preview .status-indicator.new {
    background: rgba(40, 167, 69, 0.9);
    color: white;
}

.gallery-preview .status-indicator.existing {
    background: rgba(13, 110, 253, 0.9);
    color: white;
}

.gallery-preview .status-indicator.pending {
    background: rgba(255, 193, 7, 0.9);
    color: #212529;
}

/* Responsive Video Styles */
@media (max-width: 768px) {
    .featured-video-upload-area,
    .video-gallery-upload-area {
        padding: 1.5rem 1rem;
    }

    .featured-video-upload-icon,
    .video-gallery-upload-icon {
        font-size: 2.5rem;
    }

    .featured-video-upload-text,
    .video-gallery-upload-text {
        font-size: 1rem;
    }

    .video-play-button {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .featured-video-upload-btn,
    .video-gallery-upload-btn {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .video-play-button {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}

/* ===================================================================
   MERGED STYLES FROM ARTICLE.CSS - UPLOAD AREAS ENHANCEMENT
   =================================================================== */

/* Enhanced Gallery Upload Area - Consolidated from article.css */
.gallery-upload-area {
    background: linear-gradient(145deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px dashed #dee2e6 ;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.gallery-upload-area:hover {
    border-color: #0d6efd ;
    background: linear-gradient(145deg, #e3f2fd 0%, #f8f9fa 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.15);
}

.gallery-upload-area.drag-over {
    border-color: #28a745 ;
    background: linear-gradient(145deg, #d4edda 0%, #f8f9fa 100%);
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.2);
}

.gallery-upload-area .upload-prompt {
    pointer-events: auto ;
    transition: all 0.3s ease;
}

.gallery-upload-area:hover .upload-prompt {
    transform: translateY(-2px);
}

/* Enhanced Featured Upload Areas - Consolidated */
.featured-upload-area,
.featured-video-upload-area {
    background: linear-gradient(145deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px dashed #dee2e6 ;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer ;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.featured-upload-area:hover,
.featured-video-upload-area:hover {
    border-color: #0d6efd ;
    background: linear-gradient(145deg, #e3f2fd 0%, #f8f9fa 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(13, 110, 253, 0.15);
}

.featured-upload-area.drag-over,
.featured-video-upload-area.drag-over {
    border-color: #28a745 ;
    background: linear-gradient(145deg, #d4edda 0%, #f8f9fa 100%);
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

/* Enhanced Gallery Preview - Consolidated */
.gallery-preview {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #e9ecef;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #dee2e6;
    display: none;
}

.gallery-preview.has-images {
    display: block;
}

.gallery-preview h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gallery-preview h6 i {
    color: #007bff;
    font-size: 1.1rem;
}

/* Gallery Preview Items Container */
.gallery-preview .row {
    margin: 0;
    gap: 0.75rem;
}

.gallery-preview .col-md-3,
.gallery-preview .col-md-4 {
    padding: 0;
    margin-bottom: 0.75rem;
}

/* Enhanced File Preview Items - Consolidated */
.gallery-preview .position-relative {
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: white;
    height: 140px;
    display: flex;
    flex-direction: row;
    min-width: 280px;
}

.gallery-preview .position-relative:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.gallery-preview img,
.gallery-preview video {
    border-radius: 8px 0 0 8px;
    transition: all 0.3s ease;
    width: 120px;
    height: 100%;
    object-fit: cover;
    flex-shrink: 0;
}

.gallery-preview .position-relative:hover img,
.gallery-preview .position-relative:hover video {
    transform: scale(1.05);
}

/* File Info in Gallery Preview */
.gallery-preview .position-relative .file-info {
    padding: 0.75rem;
    background: white;
    border-left: 1px solid #e9ecef;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
}

.gallery-preview .position-relative .file-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-preview .position-relative .file-size {
    font-size: 0.65rem;
    color: #6c757d;
    background: rgba(108, 117, 125, 0.12);
    padding: 0.12rem 0.25rem;
    border-radius: 6px;
    display: inline-block;
    width: fit-content;
    border: 1px solid rgba(108, 117, 125, 0.15);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-weight: 500;
}

/* Enhanced Remove/Delete Buttons - Consolidated */
.remove-file-btn,
.btn-danger.position-absolute {
    opacity: 0.9;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    background: rgba(220, 53, 69, 0.9) ;
    border: none;
    color: white;
}

.remove-file-btn:hover,
.btn-danger.position-absolute:hover {
    opacity: 1;
    background: rgba(220, 53, 69, 1) ;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}

/* Enhanced Restore Buttons - Consolidated */
.btn-success.position-absolute {
    opacity: 0.9;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    background: rgba(25, 135, 84, 0.9) ;
    border: none;
    color: white;
}

.btn-success.position-absolute:hover {
    opacity: 1;
    background: rgba(25, 135, 84, 1) ;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(25, 135, 84, 0.4);
}

/* Enhanced Responsive Grid Layouts - Consolidated */
/* Force consistent 2-column layout for image galleries */
.gallery-preview .col-md-3 {
    flex: 0 0 auto;
    width: 50%;
}

@media (max-width: 991.98px) {
    .gallery-preview .col-md-3 {
        width: 50%;
    }
}

@media (max-width: 767.98px) {
    .gallery-preview .col-md-3 {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .gallery-preview .col-md-3 {
        width: 100%;
    }
}

/* Video gallery layouts */
.gallery-preview .col-md-4 {
    flex: 0 0 auto;
    width: 50%;
}

@media (max-width: 991.98px) {
    .gallery-preview .col-md-4 {
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .gallery-preview .col-md-4 {
        width: 100%;
    }
}

/* Enhanced File Info Overlays - Consolidated */
.file-info-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
    border-radius: 0 0 8px 8px;
    padding: 0.5rem;
    font-size: 0.7rem;
    color: white;
    transition: all 0.3s ease;
}

.position-relative:hover .file-info-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.6) 50%, transparent 100%);
}

/* Enhanced Existing Media Management - Consolidated */
/* Marked for deletion state */
.gallery-preview [style*="opacity: 0.5"] {
    filter: grayscale(100%);
    position: relative;
}

.gallery-preview [style*="opacity: 0.5"]::after {
    content: "ΘΕΣΕ ΔΙΑΓΡΑΦΘΕΙ";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(220, 53, 69, 0.9);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    z-index: 10;
    pointer-events: none;
}

/* Enhanced Card Styles - Consolidated */
.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* ===================================================================
   CARD LAYOUT STYLES FOR UPLOAD SECTIONS
   =================================================================== */

/* Upload Cards for Column Layout */
.upload-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.upload-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #007bff;
}

.upload-card .card-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.upload-card .card-header.bg-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%) ;
}

.upload-card .card-header.bg-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) ;
}

.upload-card .card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.upload-card .card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.upload-card .card-title i {
    font-size: 1.25rem;
}

/* Video Card Specific Styles */
.video-upload-card .card-header {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) ;
}

.video-upload-card:hover {
    border-color: #28a745;
}

/* Card Content Area */
.card-upload-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 200px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.card-upload-area.drag-over {
    border-color: #007bff;
    background: #e3f2fd;
}

.video-upload-card .card-upload-area.drag-over {
    border-color: #28a745;
    background: #e8f5e8;
}

.card-upload-icon {
    font-size: 2.5rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.card-upload-text {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
}

.card-upload-hint {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.card-upload-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.card-upload-btn:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.video-upload-card .card-upload-btn {
    background: #28a745;
}

.video-upload-card .card-upload-btn:hover {
    background: #20c997;
}

/* Card Preview Areas */
.card-preview-area {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

.card-current-media {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.card-current-media h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.card-current-media img,
.card-current-media video {
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    height: auto;
}

/* ===================================================================
   COMPREHENSIVE RESPONSIVE ADJUSTMENTS
   =================================================================== */

@media (max-width: 768px) {
    .gallery-upload-area {
        padding: 1.5rem 1rem;
    }

    .gallery-upload-area .display-4 {
        font-size: 2rem;
    }

    .upload-card .card-body {
        padding: 1rem;
    }

    .card-upload-area {
        padding: 1rem;
        min-height: 150px;
    }

    .card-upload-icon {
        font-size: 2rem;
    }

    .card-upload-text {
        font-size: 0.9rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .gallery-upload-area {
        padding: 1rem;
    }

    .card-header {
        padding: 0.75rem 1rem;
    }

    /* Removed generic .card-body rule to prevent conflicts with custom card bodies */

    .upload-card {
        margin-bottom: 1rem;
    }

    .card-upload-area {
        min-height: 120px;
        padding: 0.75rem;
    }

    .card-upload-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.875rem;
    }
}

/* ===================================================================
   DARK MODE SUPPORT (OPTIONAL)
   =================================================================== */

@media (prefers-color-scheme: dark) {
    .gallery-upload-area {
        background: linear-gradient(145deg, #2d3748 0%, #1a202c 100%);
        border-color: #4a5568 ;
        color: #e2e8f0;
    }

    .gallery-upload-area:hover {
        background: linear-gradient(145deg, #4a5568 0%, #2d3748 100%);
        border-color: #63b3ed ;
    }

    .featured-upload-area,
    .featured-video-upload-area {
        background: linear-gradient(145deg, #2d3748 0%, #1a202c 100%);
        border-color: #4a5568 ;
        color: #e2e8f0;
    }

    .gallery-preview {
        background: #2d3748;
        border-color: #4a5568;
    }

    .upload-card {
        background: #2d3748;
        border-color: #4a5568;
    }

    .card-upload-area {
        background: #1a202c;
        border-color: #4a5568;
    }
}

/* ===================================================================
   CLICKABLE UPLOAD AREAS - EXPLICIT CURSOR RULES
   =================================================================== */

/* Ensure all upload areas are clearly clickable */
.featured-upload-area,
.featured-video-upload-area,
.gallery-upload-area,
#image-gallery-dropzone,
#video-gallery-dropzone {
    cursor: pointer ;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Upload prompt elements should be explicitly clickable */
.upload-prompt {
    cursor: pointer ;
    pointer-events: auto ;
}

/* ================================================================
   MOBILE OVERFLOW CONTAINMENT FIXES
   Ensures map (locationSection) and gallery pickers never overflow
   their parent cards on very small screens (reported issue)
   ================================================================ */
@media (max-width: 640px) {
    /* Card body containing map */
    #locationSection .location-card-body {
        overflow: hidden; /* Prevent leaflets absolute children from pushing width */
        position: relative;
    }

    /* Leaflet container adjustments */
    #locationSection .leaflet-container,
    #locationSection .leaflet-map,
    #locationSection [id^="leaflet"],
    #locationSection .map-wrapper {
        max-width: 100% ;
        width: 100% ;
        box-sizing: border-box;
    }

    /* Force any inline width on map canvas to respect parent width */
    #locationSection .leaflet-container canvas,
    #locationSection .leaflet-container img {
        max-width: 100% ;
        height: auto;
    }

    /* Prevent horizontal scroll on the section */
    #locationSection { overflow-x: hidden; }

    /* Gallery upload areas inside cards */
    .card .gallery-upload-area,
    .card .featured-upload-area,
    .card .featured-video-upload-area {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    /* Tighten padding slightly if causing overflow */
    .card .gallery-upload-area { padding-left: 0.75rem; padding-right: 0.75rem; }

    /* Ensure internal prompt scales down */
    .gallery-upload-area .upload-prompt h6,
    .gallery-upload-area .upload-prompt p {
        word-wrap: break-word;
        white-space: normal;
    }

    /* Dedicated gallery card bodies to isolate from global .card-body styles */
    .image-gallery-card-body,
    .video-gallery-card-body,
    .location-card-body {
        padding: 1.35rem 1.4rem; /* increased from 1rem 1.1rem for more breathing space */
        background-color: #fff;
        display: block ;
        visibility: visible ;
    }

    /* Ensure location card body is always visible when parent is visible */
    #locationSection[style*="display: block"] .location-card-body,
    #locationSection[style*="display:block"] .location-card-body {
        display: block ;
        visibility: visible ;
        opacity: 1 ;
        height: auto ;
        overflow: visible ;
    }

    /* Extra horizontal padding for specific side panel cards */
    .featured-image-card-body,
    .featured-video-card-body,
    .article-settings-card-body {
        padding-left: 1.75rem;
        padding-right: 1.75rem;
    }

    @media (max-width: 576px) {
        .featured-image-card-body,
        .featured-video-card-body,
        .article-settings-card-body { padding-left: 1.3rem; padding-right: 1.3rem; }
    }

    /* Slightly reduce on very narrow devices to prevent horizontal scroll */
    @media (max-width: 400px) {
        .image-gallery-card-body,
        .video-gallery-card-body,
        .location-card-body { padding: 1.1rem 1.05rem; }
    }

    /* Image Gallery Card Height & Layout Adjustments */
    .image-gallery-card-body {
        position: relative;
        display: flex;
        flex-direction: column;
        gap: 0.85rem;
        min-height: 360px; /* Increased so dropzone + previews χωρούν */
    }
    .image-gallery-card-body .gallery-upload-area {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        flex: 1 0 auto;
    }
    .image-gallery-card-body #image-gallery-preview { flex: 0 0 auto; }

    @media (max-width: 768px) {
        .image-gallery-card-body { min-height: 380px; }
    }
    @media (max-width: 576px) {
        .image-gallery-card-body { min-height: 400px; }
    }
    @media (max-width: 480px) {
        .image-gallery-card-body { min-height: 420px; }
    }

    @media (max-width: 576px) {
        .image-gallery-card-body,
        .video-gallery-card-body {
            padding: 0.85rem 0.85rem;
        }
    }
}

/* Extra small screens safeguard */
@media (max-width: 420px) {
    #locationSection .leaflet-container { min-height: 240px; }
    .gallery-upload-area { min-height: 110px; }
    /* Extra escalation for very small devices so that dropzone + previews don't overflow */
    .image-gallery-card-body { min-height: 440px; }
    /* Add safe spacing below image gallery when expanded so it doesn't visually collide with video card */
    .image-gallery-card-body { margin-bottom: 0.85rem; }
}

/* Ultra small devices (older phones / very narrow viewports) */
@media (max-width: 360px) {
    .image-gallery-card-body { min-height: 220px; }
}

/* Upload icons and text should be clickable */
.upload-prompt i,
.upload-prompt p,
.upload-prompt small,
.upload-prompt .display-4,
.upload-prompt .display-6 {
    cursor: pointer ;
    pointer-events: auto ; /* Allow clicks instead of blocking them */
}

/* Ensure Bootstrap classes don't interfere */
.cursor-pointer {
    cursor: pointer ;
}

/* ===================================================================
   FORCE CLICKABLE UPLOAD AREAS - OVERRIDE ALL BLOCKING STYLES
   =================================================================== */

/* Force clickable upload areas with highest priority */
.featured-upload-area,
.featured-video-upload-area,
.gallery-upload-area,
#image-gallery-dropzone,
#video-gallery-dropzone,
.upload-prompt,
.upload-prompt *:not(button):not(.btn):not(img):not(video):not(iframe) {
    cursor: pointer ;
    pointer-events: auto ;
    user-select: none ;
}

/* Ensure no z-index issues */
.upload-prompt {
    position: relative ;
    z-index: 1 ;
}

/* Override any conflicting pointer-events */
.gallery-upload-area *:not(.gallery-preview-item):not(button):not(.btn):not(img):not(video):not(iframe) {
    pointer-events: auto ;
}

.featured-upload-area *:not(button):not(.btn):not(img):not(video):not(iframe),
.featured-video-upload-area *:not(button):not(.btn):not(img):not(video):not(iframe) {
    pointer-events: auto ;
}

/* Debug styles for testing */
.upload-prompt:hover {
    background-color: rgba(0, 123, 255, 0.1) ;
    outline: 2px dashed rgba(0, 123, 255, 0.3) ;
}

/* ===================================================================
   COMPACT VIDEO PREVIEW STYLES
   =================================================================== */

/* Compact featured video preview */
.featured-preview-item video {
    height: 80px ;
    object-fit: cover;
}

.featured-preview-item .ratio {
    height: 80px ;
    --bs-aspect-ratio: none ;
}

.featured-preview-item iframe {
    height: 80px ;
}

/* Compact video info */
.featured-preview-info {
    padding: 0.4rem 0.6rem;
}

.featured-preview-name {
    font-size: 0.75rem;
    margin-bottom: 0.1rem;
}

.featured-preview-size {
    font-size: 0.65rem;
}

.admin-approval-notice {
    font-size: 0.65rem;
    margin-top: 0.25rem;
    padding: 0.2rem 0.4rem;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.2);
    border-radius: 3px;
    color: #856404;
}

/* Mobile adjustments for compact video */
@media (max-width: 576px) {
    .featured-preview-item video,
    .featured-preview-item .ratio,
    .featured-preview-item iframe {
        height: 60px ;
    }

    .featured-preview-info {
        padding: 0.3rem 0.5rem;
    }
}

/* ===================================================================
   RESPONSIVE STYLES FOR ARTICLE VIDEO GALLERY
   =================================================================== */

@media (max-width: 992px) {
    .article-video-gallery-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1rem;
    }

    .article-video-gallery-preview-item {
        min-height: 240px;
    }

    .article-video-gallery-preview-video {
        height: 140px;
    }
}

@media (max-width: 768px) {
    .article-video-gallery-preview-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }

    .article-video-gallery-preview-item {
        min-height: 200px;
    }

    .article-video-gallery-preview-video {
        height: 120px;
    }

    .article-video-gallery-preview-info {
        padding: 0.625rem;
    }

    .article-video-gallery-preview-name {
        font-size: 0.8rem;
        margin-bottom: 0.1rem;
    }

    .article-video-gallery-preview-size {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}

@media (max-width: 576px) {
    /* Force 3-column layout using Bootstrap col-4 for mobile */
    #video-gallery-files-list.row > [class*='col-'] { padding-left: .4rem; padding-right: .4rem; }
    #video-gallery-files-list.row { margin-left: -.4rem; margin-right: -.4rem; }

    .article-video-gallery-preview-item { min-height: 150px; }
    .article-video-gallery-preview-item .video-thumb-placeholder { padding-bottom: 58% ; }
    .article-video-gallery-preview-video { height: 90px; }

    .article-video-gallery-preview-overlay {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }

    .article-video-gallery-preview-info {
        padding: 0.5rem;
    }

    .article-video-gallery-preview-name {
        font-size: 0.65rem;
        margin-bottom: 0.08rem;
    }

    .article-video-gallery-preview-size {
        font-size: 0.55rem;
        padding: 0.15rem 0.3rem;
    }
}

/* ===================================================================
   IMAGE SUBMISSION SUCCESS ALERT STYLES
   =================================================================== */
/* Image Submission Success Alert Styling */
#imageSubmissionAlert {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 1055;
    max-width: 400px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    border: none;
    border-left: 4px solid #198754;
    background: linear-gradient(135deg, #d1e7dd 0%, #f8f9fa 100%);
    backdrop-filter: blur(10px);
    animation: slideInRight 0.5s ease-out;
}

#imageSubmissionAlert.show {
    display: block ;
    opacity: 1;
    transform: translateX(0);
}

#imageSubmissionAlert .bi-check-circle-fill {
    color: #198754;
    text-shadow: 0 2px 4px rgba(25, 135, 84, 0.2);
}

#imageSubmissionAlert strong {
    color: #0f5132;
    font-weight: 600;
}

#imageSubmissionAlert .text-success-emphasis {
    color: #146c43;
    font-size: 0.875rem;
}

#imageSubmissionAlert .btn-close {
    filter: brightness(0.8);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ================================================================
   MOBILE LOCATION MAP FIX
   Ensures location section and map display properly on mobile
   when visible (don't override display: none from JS)
   ================================================================ */
@media (max-width: 768px) {
    /* Ensure location section card is fully visible when shown */
    #locationSection[style*="display: block"],
    #locationSection[style*="display:block"] {
        display: block ;
        visibility: visible ;
        width: 100% ;
        overflow: visible ;
    }

    #locationSection[style*="display: block"] .card,
    #locationSection[style*="display:block"] .card {
        display: block;
        visibility: visible ;
        width: 100%;
    }

    /* Ensure location card body is visible and properly sized when shown */
    #locationSection[style*="display: block"] .location-card-body,
    #locationSection[style*="display:block"] .location-card-body {
        display: block ;
        visibility: visible;
        min-height: 450px ;
        overflow: visible ;
    }

    /* Ensure map container is visible and properly sized */
    #locationSection[style*="display: block"] .leaflet-container,
    #locationSection[style*="display:block"] .leaflet-container {
        display: block ;
        visibility: visible ;
        height: 350px ;
        min-height: 350px ;
        width: 100% ;
        position: relative ;
    }

    /* Ensure map wrapper is visible */
    #locationSection[style*="display: block"] .location-map-container,
    #locationSection[style*="display:block"] .location-map-container,
    #locationSection[style*="display: block"] .map-wrapper,
    #locationSection[style*="display:block"] .map-wrapper {
        display: block ;
        visibility: visible ;
        height: 350px ;
        min-height: 350px ;
    }

    /* Ensure search container is visible */
    #locationSection[style*="display: block"] .location-search-container,
    #locationSection[style*="display:block"] .location-search-container {
        display: block ;
        visibility: visible ;
        margin-bottom: 15px ;
    }

    /* Ensure Leaflet tiles and layers render */
    #locationSection .leaflet-tile-container,
    #locationSection .leaflet-pane {
        display: block ;
        visibility: visible ;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    #locationSection[style*="display: block"] .location-card-body,
    #locationSection[style*="display:block"] .location-card-body {
        min-height: 400px ;
    }

    #locationSection[style*="display: block"] .leaflet-container,
    #locationSection[style*="display:block"] .leaflet-container,
    #locationSection[style*="display: block"] .location-map-container,
    #locationSection[style*="display:block"] .location-map-container,
    #locationSection[style*="display: block"] .map-wrapper,
    #locationSection[style*="display:block"] .map-wrapper {
        height: 300px ;
        min-height: 300px ;
    }
}
