/* Modern Image Gallery Styles */
.image-gallery-container {
    max-width: 100%;
    margin: 0 auto;
}

.main-image-container {
    position: relative;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.main-image-wrapper {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    background: #f8f9fa;
}

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

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

/* Navigation Arrows */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-nav:hover {
    background: rgba(0,0,0,0.9);
    transform: translateY(-50%) scale(1.1);
    color: #fff;
}

.gallery-nav-prev {
    left: 15px;
}

.gallery-nav-next {
    right: 15px;
}

/* Image Counter */
.image-counter {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

/* Fullscreen Button */
.fullscreen-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-btn:hover {
    background: rgba(0,0,0,0.9);
    transform: scale(1.1);
    color: #fff;
}

/* Thumbnail Gallery */
.thumbnail-gallery {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.thumbnail-gallery::-webkit-scrollbar {
    height: 6px;
}

.thumbnail-gallery::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.thumbnail-gallery::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.thumbnail-gallery::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.thumbnail-item {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
}

.thumbnail-item:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

.thumbnail-item.active {
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0,123,255,0.4);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.thumbnail-item:hover img {
    transform: scale(1.1);
}

/* No Image Placeholder */
.no-image-placeholder {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.placeholder-content {
    text-align: center;
    color: #6c757d;
}

/* Fullscreen Modal */
.fullscreen-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.95);
    animation: fadeIn 0.3s ease;
}

.fullscreen-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-content {
    position: relative;
    max-width: 95%;
    max-height: 95%;
    text-align: center;
}

.fullscreen-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.fullscreen-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-close:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.fullscreen-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-nav:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-50%) scale(1.1);
}

.fullscreen-nav.prev {
    left: 30px;
}

.fullscreen-nav.next {
    right: 30px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateX(20px);
    }
    to { 
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-image-wrapper {
        height: 300px;
    }
    
    .gallery-nav {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .gallery-nav-prev {
        left: 10px;
    }
    
    .gallery-nav-next {
        right: 10px;
    }
    
    .fullscreen-btn {
        width: 35px;
        height: 35px;
        font-size: 14px;
        top: 10px;
        right: 10px;
    }
    
    .image-counter {
        bottom: 10px;
        right: 10px;
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .thumbnail-item {
        width: 60px;
        height: 60px;
    }
    
    .fullscreen-nav {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .fullscreen-nav-prev {
        left: 15px;
    }
    
    .fullscreen-nav-next {
        right: 15px;
    }
    
    .fullscreen-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

/* Touch gestures for mobile */
@media (max-width: 768px) {
    .main-image {
        cursor: pointer;
    }
    
    .main-image-wrapper {
        touch-action: pan-y;
    }
}

/* Loading animation */
.image-loading {
    position: relative;
}

.image-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1;
}

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