/**
 * Complete Product Image Carousel Styles
 * File: views/css/productcarousel.css
 */

.product-carousel-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 20px auto;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    z-index: 10;
}

.product-carousel-main {
    position: relative;
    overflow: hidden;
}

.carousel-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.carousel-slide {
    flex: 0 0 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    min-height: 400px;
}

.carousel-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.carousel-image:hover {
    transform: scale(1.02);
}

.carousel-image:focus {
    outline: 3px solid #007cba;
    outline-offset: 2px;
}

/* Navigation Arrows */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.carousel-nav:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-50%) scale(1.1);
}

.carousel-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-prev {
    left: 16px;
}

.carousel-next {
    right: 16px;
}

.carousel-nav svg {
    color: #333;
    transition: color 0.3s ease;
}

.carousel-nav:hover svg {
    color: #007cba;
}

/* Pagination Dots */
.carousel-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: rgba(248, 249, 250, 0.9);
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: #d1d5db;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.carousel-dot:hover {
    background: #9ca3af;
    transform: scale(1.2);
}

.carousel-dot.active {
    background: #007cba;
    transform: scale(1.3);
}

.carousel-dot.active::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid #007cba;
    border-radius: 50%;
    opacity: 0.3;
}

/* Thumbnails */
.carousel-thumbnails {
    margin-top: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    overflow: hidden;
}

.thumbnails-track {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

.thumbnails-track::-webkit-scrollbar {
    height: 4px;
}

.thumbnails-track::-webkit-scrollbar-track {
    background: transparent;
}

.thumbnails-track::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

.thumbnails-track::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.thumbnail-item {
    flex: 0 0 auto;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
}

.thumbnail-item:hover {
    transform: scale(1.05);
    border-color: #d1d5db;
}

.thumbnail-item.active {
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.thumbnail-item:hover .thumbnail-image {
    transform: scale(1.1);
}

/* Controls */
.carousel-controls {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 15;
}

.carousel-play-pause {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.carousel-play-pause:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.carousel-play-pause svg {
    color: #333;
    transition: color 0.3s ease;
}

.carousel-play-pause:hover svg {
    color: #007cba;
}

/* Loading States */
.carousel-slide.loading {
    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;
    }
}

/* Lightbox/Zoom Modal Styles */
.carousel-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.carousel-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.lightbox-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    flex: 1;
    padding-right: 16px;
}

.lightbox-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    color: #666;
}

.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

.lightbox-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.lightbox-image-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    min-height: 400px;
    overflow: hidden;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: #333;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.1);
    color: #007cba;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-thumbnails {
    padding: 16px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.lightbox-thumbnails-track {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

.lightbox-thumbnails-track::-webkit-scrollbar {
    height: 6px;
}

.lightbox-thumbnails-track::-webkit-scrollbar-track {
    background: transparent;
}

.lightbox-thumbnails-track::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.lightbox-thumbnail {
    flex: 0 0 auto;
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    opacity: 0.7;
}

.lightbox-thumbnail:hover {
    opacity: 1;
    transform: scale(1.05);
}

.lightbox-thumbnail.active {
    border-color: #007cba;
    opacity: 1;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.3);
}

.lightbox-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

/* Lightbox animations */
.carousel-lightbox.opening .lightbox-container {
    animation: lightboxSlideIn 0.3s ease-out;
}

.carousel-lightbox.closing .lightbox-container {
    animation: lightboxSlideOut 0.3s ease-in;
}

@keyframes lightboxSlideIn {
    from {
        transform: scale(0.8) translateY(40px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes lightboxSlideOut {
    from {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
    to {
        transform: scale(0.8) translateY(40px);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .product-carousel-container {
        margin: 15px 10px;
        border-radius: 6px;
    }
    
    .carousel-slide {
        min-height: 300px;
    }
    
    .carousel-nav {
        width: 40px;
        height: 40px;
    }
    
    .carousel-prev {
        left: 8px;
    }
    
    .carousel-next {
        right: 8px;
    }
    
    .carousel-controls {
        top: 8px;
        right: 8px;
    }
    
    .carousel-play-pause {
        width: 36px;
        height: 36px;
    }
    
    .thumbnail-item {
        width: 60px;
        height: 60px;
    }
    
    .carousel-pagination {
        padding: 12px;
    }
    
    /* Lightbox responsive */
    .lightbox-overlay {
        padding: 10px;
    }
    
    .lightbox-container {
        max-height: 95vh;
        border-radius: 8px;
    }
    
    .lightbox-header {
        padding: 12px 16px;
    }
    
    .lightbox-title {
        font-size: 16px;
    }
    
    .lightbox-nav {
        width: 48px;
        height: 48px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
    
    .lightbox-thumbnail {
        width: 50px;
        height: 50px;
    }
    
    .lightbox-counter {
        bottom: 10px;
        font-size: 13px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    .product-carousel-container {
        margin: 10px 5px;
        border-radius: 4px;
    }
    
    .carousel-slide {
        min-height: 250px;
    }
    
    .carousel-nav {
        width: 36px;
        height: 36px;
    }
    
    .carousel-nav svg {
        width: 18px;
        height: 18px;
    }
    
    .thumbnail-item {
        width: 50px;
        height: 50px;
    }
    
    .carousel-dot {
        width: 10px;
        height: 10px;
    }
    
    /* Lightbox mobile */
    .lightbox-overlay {
        padding: 5px;
    }
    
    .lightbox-nav {
        width: 44px;
        height: 44px;
    }
    
    .lightbox-nav svg {
        width: 24px;
        height: 24px;
    }
    
    .lightbox-thumbnail {
        width: 45px;
        height: 45px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .carousel-track,
    .carousel-image,
    .carousel-nav,
    .carousel-dot,
    .thumbnail-item,
    .carousel-play-pause,
    .lightbox-container {
        transition: none !important;
        animation: none !important;
    }
    
    .carousel-image:hover,
    .thumbnail-item:hover .thumbnail-image {
        transform: none !important;
    }
}

/* Focus styles for keyboard navigation */
.carousel-nav:focus,
.carousel-dot:focus,
.thumbnail-item:focus,
.carousel-play-pause:focus,
.lightbox-close:focus,
.lightbox-nav:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .carousel-nav,
    .carousel-play-pause,
    .lightbox-close,
    .lightbox-nav {
        background: #fff;
        border: 2px solid #000;
    }
    
    .carousel-dot {
        border: 2px solid #000;
    }
    
    .carousel-dot.active {
        background: #000;
    }
    
    .lightbox-overlay {
        background: rgba(0, 0, 0, 0.95);
    }
}

/* Print styles */
@media print {
    .carousel-nav,
    .carousel-pagination,
    .carousel-controls,
    .carousel-thumbnails,
    .carousel-lightbox {
        display: none !important;
    }
    
    .carousel-track {
        display: block !important;
    }
    
    .carousel-slide {
        display: block !important;
        page-break-inside: avoid;
        margin-bottom: 1cm;
        min-height: auto;
    }
    
    .carousel-image {
        max-height: 15cm;
    }
}