/*
public\assets\css\gallery-slider.css
 ============================================
   Gallery Slider Styles
   PBS TECHNIC HATYAI - Car Audio & Technology
   ============================================ */

/* Main Container */
.gallery-slider-container {
    position: relative;
    overflow: hidden;
    background-color: #000;
    border-radius: 0.75rem;
}

/* Slider Track */
.gallery-slider {
    display: flex;
    transition: transform 0.5s ease-in-out;
    will-change: transform;
}

/* Individual Slides */
.gallery-slide {
    min-width: 100%;
    flex-shrink: 0;
    position: relative;
}

.gallery-slide img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

/* Navigation Buttons */
.gallery-prev,
.gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.75rem;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    opacity: 0;
    backdrop-filter: blur(4px);
}

.gallery-prev {
    left: 1rem;
}

.gallery-next {
    right: 1rem;
}

.gallery-prev:hover,
.gallery-next:hover {
    background-color: #dc2626;
    transform: translateY(-50%) scale(1.1);
}

.gallery-prev:active,
.gallery-next:active {
    transform: translateY(-50%) scale(0.95);
}

/* Show buttons on hover (Desktop) */
.gallery-slider-container:hover .gallery-prev,
.gallery-slider-container:hover .gallery-next {
    opacity: 1;
}

/* Always show on touch devices */
@media (hover: none) {
    .gallery-prev,
    .gallery-next {
        opacity: 1;
    }
}

/* Dot Indicators */
.gallery-indicators {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.gallery-indicator {
    width: 12px;
    height: 12px;
    border-radius: 9999px;
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.gallery-indicator:hover {
    background-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.gallery-indicator.active {
    background-color: #ef4444 !important;
    width: 24px;
    border-radius: 6px;
}

/* Image Counter */
.gallery-slider-container .absolute.top-4.right-4 {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 10;
    backdrop-filter: blur(4px);
}

/* Loading Indicator */
.gallery-loading {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 20;
}

.gallery-loading.active {
    display: flex;
}

.gallery-loading .spinner {
    animation: spin 1s linear infinite;
    border-radius: 9999px;
    height: 3rem;
    width: 3rem;
    border: 4px solid #ef4444;
    border-top-color: transparent;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Smooth Fade In Animation */
.gallery-slide img {
    animation: fadeIn 0.5s ease-in;
}

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

/* Progress Bar (Optional) */
.gallery-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background-color: #ef4444;
    width: 0;
    transition: width 0.1s linear;
    z-index: 10;
}

/* Thumbnail Preview (Optional) */
.gallery-thumbnails {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scrollbar-width: thin;
    scrollbar-color: #ef4444 #1f2937;
}

.gallery-thumbnail {
    min-width: 80px;
    height: 60px;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 0.375rem;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.gallery-thumbnail:hover {
    opacity: 1;
    transform: scale(1.05);
}

.gallery-thumbnail.active {
    border-color: #ef4444;
    opacity: 1;
}

.gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Fullscreen Mode */
.gallery-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background-color: rgba(0, 0, 0, 0.95);
}

.gallery-fullscreen .gallery-slide img {
    height: 100vh;
    object-fit: contain;
}

.gallery-fullscreen-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.75rem;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.gallery-fullscreen-close:hover {
    background-color: #dc2626;
    transform: scale(1.1);
}

/* Zoom Controls */
.gallery-zoom-controls {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.gallery-zoom-btn {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-zoom-btn:hover {
    background-color: #dc2626;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .gallery-slide img {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .gallery-slide img {
        height: 300px;
    }
    
    .gallery-prev,
    .gallery-next {
        opacity: 1 !important;
        padding: 0.5rem;
    }
    
    .gallery-prev svg,
    .gallery-next svg {
        width: 1.25rem;
        height: 1.25rem;
    }
    
    .gallery-indicator {
        width: 8px;
        height: 8px;
    }
    
    .gallery-indicator.active {
        width: 16px;
    }
    
    .gallery-thumbnails {
        display: none; /* Hide on mobile */
    }
}

@media (max-width: 640px) {
    .gallery-slide img {
        height: 250px;
    }
    
    .gallery-prev {
        left: 0.5rem;
    }
    
    .gallery-next {
        right: 0.5rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .gallery-slider-container {
        background-color: #111;
    }
}

/* Print Styles */
@media print {
    .gallery-prev,
    .gallery-next,
    .gallery-indicators,
    .gallery-zoom-controls {
        display: none !important;
    }
}

/* Accessibility */
.gallery-prev:focus,
.gallery-next:focus,
.gallery-indicator:focus {
    outline: 2px solid #ef4444;
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .gallery-slider,
    .gallery-indicator,
    .gallery-prev,
    .gallery-next {
        transition: none !important;
    }
    
    .gallery-slide img {
        animation: none !important;
    }
}

/* Loading Skeleton */
.gallery-skeleton {
    width: 100%;
    height: 500px;
    background: linear-gradient(
        90deg,
        #1f2937 25%,
        #374151 50%,
        #1f2937 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 0.75rem;
}

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

/* Custom Scrollbar for Thumbnails */
.gallery-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.gallery-thumbnails::-webkit-scrollbar-track {
    background: #1f2937;
    border-radius: 3px;
}

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

.gallery-thumbnails::-webkit-scrollbar-thumb:hover {
    background: #dc2626;
}