/* ===== GALLERY CSS - OPTIMIZED FOR 15 SCREENSHOTS ===== */
/* File: /assets/css/gallery.css */

:root {
    /* Gallery specific color variables */
    --gallery-primary: var(--primary-blue, #1976D2);
    --gallery-primary-light: var(--primary-blue-light, #63A4FF);
    --gallery-white: var(--white, #FFFFFF);
    --gallery-text-light: var(--text-light, #666666);
    --gallery-gray-light: var(--neutral-gray-light, #F5F5F5);
    --gallery-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --gallery-shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.15);
    --gallery-radius: 20px;
    --gallery-transition: all 0.3s ease;
}

/* ========== CONTAINER & LAYOUT ========== */
.gallery-container {
    position: relative;
    overflow: hidden;
    margin: 0 auto;
    max-width: 1400px;
}

.gallery-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.gallery-section .section-title {
    text-align: center;
    margin-bottom: 60px;
}

.gallery-section .section-title h2 {
    color: var(--gallery-primary);
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.gallery-section .section-title p {
    color: var(--gallery-text-light);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ========== GALLERY TRACK & SLIDES ========== */
.gallery-track {
    display: flex;
    gap: 30px;
    padding: 20px 10px;
    scroll-behavior: smooth;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.gallery-track::-webkit-scrollbar {
    display: none;
}

.gallery-slide {
    flex: 0 0 auto;
    width: 320px;
    scroll-snap-align: start;
}

/* ========== NAVIGATION CONTROLS ========== */
.gallery-nav {
    position: relative;
    margin-bottom: 40px;
    min-height: 500px; /* Prevent layout shift during slide changes */
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gallery-white);
    border: 2px solid var(--gallery-primary);
    color: var(--gallery-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--gallery-transition);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-btn:hover:not(:disabled) {
    background: var(--gallery-primary);
    color: var(--gallery-white);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(25, 118, 210, 0.3);
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-btn svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

.prev-btn {
    left: -25px;
}

.next-btn {
    right: -25px;
}

/* ========== DOTS NAVIGATION ========== */
.gallery-dots {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 30px 0;
    max-width: 100%;
    padding: 10px 0;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gallery-gray-light);
    border: none;
    cursor: pointer;
    transition: var(--gallery-transition);
    flex-shrink: 0;
}

.dot.active {
    background: var(--gallery-primary);
    transform: scale(1.3);
}

.dot:hover:not(.active) {
    background: var(--gallery-primary-light);
    transform: scale(1.1);
}

/* ========== THUMBNAILS ========== */
.gallery-thumbnails {
    margin-top: 30px;
    max-width: 100%;
    overflow: hidden;
}

.thumbnails-track {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
    justify-content: center;
    padding: 10px;
}

.thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    padding: 0;
    background: none;
    cursor: pointer;
    transition: var(--gallery-transition);
    opacity: 0.7;
    position: relative;
}

.thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gallery-primary);
    opacity: 0;
    transition: var(--gallery-transition);
    border-radius: 8px;
}

.thumbnail.active {
    border-color: var(--gallery-primary);
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(25, 118, 210, 0.3);
}

.thumbnail.active::before {
    opacity: 0.1;
}

.thumbnail:hover {
    opacity: 1;
    transform: scale(1.05);
}

.thumbnail:hover::before {
    opacity: 0.05;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* ========== LIGHTBOX STYLES ========== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.lightbox-img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.close-lightbox {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    padding: 5px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.close-lightbox:hover {
    opacity: 0.8;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightbox-nav:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-counter {
    position: absolute;
    bottom: -40px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    font-size: 1rem;
    font-weight: 500;
}


/* ========== SCREENSHOT CARDS ========== */
.screenshot-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--gallery-white);
    border-radius: var(--gallery-radius);
    overflow: hidden;
    box-shadow: var(--gallery-shadow);
    transition: var(--gallery-transition);
    position: relative;
    z-index: 1;
}

.screenshot-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--gallery-shadow-hover);
    z-index: 2;
}

.screenshot-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gallery-primary), var(--gallery-primary-light));
    opacity: 0;
    transition: var(--gallery-transition);
}

.screenshot-card:hover::before {
    opacity: 1;
}

/* Screenshot Header */
.screenshot-header {
    background: linear-gradient(135deg, var(--gallery-primary), var(--gallery-primary-light));
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.device-indicator {
    display: flex;
    gap: 6px;
}

.device-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gallery-white);
    opacity: 0.8;
}

.device-dot:nth-child(1) { opacity: 0.6; }
.device-dot:nth-child(2) { opacity: 0.8; }
.device-dot:nth-child(3) { opacity: 1; }

.screen-label {
    color: var(--gallery-white);
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Screenshot Image */
.screenshot-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    position: relative;
    min-height: 400px;
}

.screenshot-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.screenshot-image img {
    width: 100%;
    max-width: 250px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 1;
    transition: var(--gallery-transition);
}

.screenshot-card:hover .screenshot-image img {
    transform: scale(1.02);
}

/* Screenshot Caption */
.screenshot-caption {
    padding: 25px;
    background: var(--gallery-white);
    flex-shrink: 0;
}

.screenshot-caption h4 {
    color: var(--gallery-primary);
    margin-bottom: 12px;
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.3;
}

.screenshot-caption p {
    color: var(--gallery-text-light);
    line-height: 1.6;
    margin: 0;
    font-size: 0.95rem;
}

/* ========== PROGRESS INDICATOR ========== */
.gallery-progress {
    width: 100%;
    height: 4px;
    background: var(--gallery-gray-light);
    border-radius: 2px;
    margin-top: 20px;
    overflow: hidden;
}

.gallery-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--gallery-primary), var(--gallery-primary-light));
    width: 0%;
    transition: width 0.3s ease;
}

/* ========== NO IMAGES MESSAGE ========== */
.no-images-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--gallery-text-light);
    font-size: 1.1rem;
    background: var(--gallery-white);
    border-radius: var(--gallery-radius);
    border: 2px dashed var(--gallery-gray-light);
}

.no-images-message::before {
    content: "📱";
    font-size: 3rem;
    display: block;
    margin-bottom: 20px;
}

/* ========== RESPONSIVE ADJUSTMENTS ========== */
@media (max-width: 1400px) {
    .gallery-container {
        padding: 0 20px;
    }
}

@media (max-width: 1200px) {
    .gallery-slide {
        width: 300px;
    }
    
    .thumbnails-track {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }
    
    .thumbnail {
        width: 70px;
        height: 70px;
    }
    
    .prev-btn {
        left: -15px;
    }
    
    .next-btn {
        right: -15px;
    }
}

@media (max-width: 992px) {
    .gallery-section {
        padding: 60px 0;
    }
    
    .gallery-slide {
        width: 280px;
    }
    
    .screenshot-image {
        min-height: 350px;
        padding: 20px;
    }
    
    .thumbnails-track {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 10px;
    }
    
    .thumbnail {
        width: 60px;
        height: 60px;
    }
    
    .nav-btn {
        width: 40px;
        height: 40px;
    }
    
    .nav-btn svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 768px) {
    .gallery-section {
        padding: 40px 0;
    }
    
    .gallery-section .section-title h2 {
        font-size: 2rem;
    }
    
    .gallery-track {
        gap: 20px;
    }
    
    .gallery-slide {
        width: 260px;
    }
    
    .thumbnails-track {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .gallery-dots {
        gap: 6px;
    }
    
    .dot {
        width: 8px;
        height: 8px;
    }
    
    .screenshot-image {
        min-height: 300px;
    }
}

@media (max-width: 576px) {
    .gallery-slide {
        width: 240px;
    }
    
    .thumbnails-track {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .thumbnail {
        width: 50px;
        height: 50px;
    }
    
    .screenshot-image {
        padding: 15px;
        min-height: 250px;
    }
    
    .screenshot-caption {
        padding: 20px;
    }
    
    .screenshot-caption h4 {
        font-size: 1.1rem;
    }
    
    .screenshot-caption p {
        font-size: 0.9rem;
    }
    
    .nav-btn {
        width: 35px;
        height: 35px;
    }
    
    .prev-btn {
        left: -10px;
    }
    
    .next-btn {
        right: -10px;
    }
}

/* ========== ANIMATIONS ========== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-slide {
    animation: slideIn 0.5s ease forwards;
}

/* Staggered animation for multiple items */
.gallery-slide:nth-child(1) { animation-delay: 0.05s; }
.gallery-slide:nth-child(2) { animation-delay: 0.1s; }
.gallery-slide:nth-child(3) { animation-delay: 0.15s; }
.gallery-slide:nth-child(4) { animation-delay: 0.2s; }
.gallery-slide:nth-child(5) { animation-delay: 0.25s; }
.gallery-slide:nth-child(6) { animation-delay: 0.3s; }
.gallery-slide:nth-child(7) { animation-delay: 0.35s; }
.gallery-slide:nth-child(8) { animation-delay: 0.4s; }
.gallery-slide:nth-child(9) { animation-delay: 0.45s; }
.gallery-slide:nth-child(10) { animation-delay: 0.5s; }
.gallery-slide:nth-child(11) { animation-delay: 0.55s; }
.gallery-slide:nth-child(12) { animation-delay: 0.6s; }
.gallery-slide:nth-child(13) { animation-delay: 0.65s; }
.gallery-slide:nth-child(14) { animation-delay: 0.7s; }
.gallery-slide:nth-child(15) { animation-delay: 0.75s; }

/* ========== PRINT STYLES ========== */
@media print {
    .gallery-nav,
    .gallery-dots,
    .gallery-thumbnails,
    .nav-btn,
    .gallery-progress {
        display: none !important;
    }
    
    .gallery-track {
        overflow: visible;
        flex-wrap: wrap;
        gap: 20px;
        justify-content: center;
    }
    
    .gallery-slide {
        width: 45%;
        margin-bottom: 20px;
        break-inside: avoid;
    }
    
    .screenshot-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .screenshot-card:hover {
        transform: none;
    }
}