/* Image Carousel Styles */
.image-carousel {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.carousel-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    background: white;
}

.carousel-track {
    position: relative;
    width: 100%;
    height: 500px;
    background: white;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    cursor: context-menu;
    background: white;
    border-radius: 4px;
}

/* Ensure PNG images with transparency display properly */
.carousel-slide img[src$=".png"] {
    background: white;
}


/* Error state - when image fails to load */
.carousel-slide img[data-error="true"] {
    opacity: 0.3;
    background: #ffebee;
    border: 2px dashed #f44336;
}

.carousel-arrow {
    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: 24px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
}

.carousel-arrow:hover {
    background: rgba(0,0,0,0.9);
    transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
    left: 15px;
}

.carousel-next {
    right: 15px;
}

.image-carousel:hover .carousel-arrow {
    opacity: 1;
}

.carousel-dots {
    display: flex;
    justify-content: center;
    margin-top: 15px;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background: #333;
    transform: scale(1.2);
}

.dot:hover {
    background: #666;
}

/* Context Menu Styles */
.carousel-context-menu {
    position: fixed;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 5px 0;
    min-width: 150px;
}

.carousel-context-menu-item {
    padding: 8px 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.carousel-context-menu-item:hover {
    background: #f0f0f0;
}

/* Full-screen Modal Styles */
.image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    animation: fadeIn 0.3s ease;
}

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

.image-modal-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s ease;
    background: white;
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
    transition: color 0.3s ease;
}

.image-modal-close:hover {
    color: #ccc;
}

.image-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2001;
}

.image-modal-nav:hover {
    background: rgba(0,0,0,0.9);
    transform: translateY(-50%) scale(1.1);
}

.image-modal-prev {
    left: 30px;
}

.image-modal-next {
    right: 30px;
}

.image-modal-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0,0,0,0.7);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 2001;
}

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

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Make carousel images clickable */
.carousel-slide img {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.carousel-slide img:hover {
    transform: scale(1.02);
}

/* Responsive design */
@media (max-width: 768px) {
    .carousel-track {
        height: 350px;
        background: white;
    }
    
    .carousel-slide img {
        height: 100%;
        object-fit: contain;
        object-position: center;
        background: white;
    }
    
    .carousel-arrow {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .carousel-prev {
        left: 10px;
    }
    
    .carousel-next {
        right: 10px;
    }
    
    .image-modal-nav {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .image-modal-prev {
        left: 20px;
    }
    
    .image-modal-next {
        right: 20px;
    }
    
    .image-modal-close {
        top: 15px;
        right: 25px;
        font-size: 35px;
    }
}
