/* ===============================================
   Campaign Gallery Styles
   =============================================== */

/* Gallery Section */
.campaign-gallery-section {
    padding: 20px 0;
}

.campaign-gallery-section h3 {
    margin-bottom: 30px;
    color: #2c3e50;
    font-weight: 600;
}

/* Main Gallery Swiper */
.campaign-gallery-main {
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.gallery-main-swiper {
    height: 500px;
    width: 100%;
}

.gallery-image-wrapper {
    position: relative;
    height: 100%;
    overflow: hidden;
}

.gallery-main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.gallery-image-wrapper:hover .gallery-main-image {
    transform: scale(1.05);
}

.gallery-fullscreen-btn {
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    color: #333;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.gallery-fullscreen-btn:hover {
    background: white;
    transform: scale(1.1);
}

/* Navigation Arrows */
.gallery-nav-next,
.gallery-nav-prev {
    background: rgba(255,255,255,0.9);
    color: #333;
    width: 50px;
    height: 50px;
    margin-top: -25px;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.gallery-nav-next:hover,
.gallery-nav-prev:hover {
    background: white;
    transform: scale(1.1);
}

.gallery-nav-next::after,
.gallery-nav-prev::after {
    font-size: 16px;
    font-weight: bold;
}

/* Pagination */
.gallery-pagination {
    bottom: 20px;
}

.gallery-pagination .swiper-pagination-bullet {
    background: white;
    opacity: 0.7;
    width: 12px;
    height: 12px;
}

.gallery-pagination .swiper-pagination-bullet-active {
    background: #007bff;
    opacity: 1;
    transform: scale(1.2);
}

/* Thumbnail Gallery */
.campaign-gallery-thumbs {
    margin-top: 15px;
}

.gallery-thumbs-swiper {
    height: 120px;
}

.gallery-thumbs-swiper .swiper-slide {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.gallery-thumbs-swiper .swiper-slide-thumb-active {
    opacity: 1;
}

.gallery-thumb-wrapper {
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    border: 3px solid transparent;
    transition: border-color 0.3s ease;
}

.gallery-thumbs-swiper .swiper-slide-thumb-active .gallery-thumb-wrapper {
    border-color: #007bff;
}

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

/* Grid View */
.gallery-grid-view {
    animation: fadeIn 0.3s ease;
}

.gallery-grid-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.gallery-grid-item:hover {
    transform: translateY(-5px);
}

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

.gallery-grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* View Toggle */
.gallery-view-toggle {
    margin-top: 20px;
}

#toggle-gallery-view {
    min-width: 120px;
    padding: 10px 20px;
    border-radius: 25px;
    transition: all 0.3s ease;
}

#toggle-gallery-view:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,123,255,0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-main-swiper {
        height: 300px;
    }
    
    .gallery-thumbs-swiper {
        height: 80px;
    }
    
    .gallery-nav-next,
    .gallery-nav-prev {
        width: 40px;
        height: 40px;
        margin-top: -20px;
    }
    
    .gallery-fullscreen-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .gallery-grid-item {
        margin-bottom: 15px;
    }
}

@media (max-width: 576px) {
    .gallery-main-swiper {
        height: 250px;
    }
    
    .gallery-thumbs-swiper {
        height: 60px;
    }
    
    .campaign-gallery-section {
        padding: 15px 0;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading State */
.gallery-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: #666;
}

.gallery-loading i {
    margin-right: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===============================================
   Campaign Gallery Upload Styles
   =============================================== */

/* Gallery Upload Wrapper */
.campaign-gallery-upload-wrapper {
    margin-top: 15px;
}

.gallery-preview-grid {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

/* Gallery Preview Items */
.gallery-preview-item {
    position: relative;
    aspect-ratio: 4/3;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

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

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

.gallery-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.gallery-remove-btn {
    background: #dc3545;
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.gallery-remove-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Loading Placeholder */
.gallery-loading-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f8f9fa;
    color: #6c757d;
    text-align: center;
    padding: 20px;
}

.gallery-loading-placeholder i {
    font-size: 24px;
    margin-bottom: 10px;
}

.gallery-loading-placeholder span {
    font-size: 12px;
    word-break: break-all;
}

.gallery-preview-item.loading {
    border-style: solid;
    border-color: #007bff;
    animation: pulse 2s infinite;
}

/* Gallery Upload Button */
#gallery-upload-btn {
    border: 2px dashed #007bff;
    background: rgba(0,123,255,0.1);
    color: #007bff;
    padding: 12px 24px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

#gallery-upload-btn:hover {
    background: rgba(0,123,255,0.2);
    border-color: #0056b3;
    color: #0056b3;
    transform: translateY(-1px);
}

#gallery-upload-btn i {
    margin-right: 8px;
}

.gallery-upload-info {
    margin-top: 8px;
}

.gallery-upload-info small {
    font-size: 11px;
    line-height: 1.4;
}

/* Empty State */
.gallery-preview-grid:empty {
    display: none;
}

/* Responsive Adjustments */
@media (max-width: 576px) {
    .gallery-preview-item {
        aspect-ratio: 1;
    }
    
    .gallery-loading-placeholder {
        padding: 15px;
    }
    
    .gallery-loading-placeholder i {
        font-size: 20px;
    }
    
    #gallery-upload-btn {
        width: 100%;
        padding: 15px;
    }
}