/* Gallery Page Styles */

.gallery-hero {
    background: linear-gradient(135deg, var(--primary) 0%, #b51329 100%);
    color: var(--text-primary);
    padding: 120px 0 60px;
    margin-top: 60px;
    text-align: center;
}

.gallery-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.gallery-subtitle {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
    opacity: 0.9;
}

/* Gallery Filters */
.gallery-filters {
    background: var(--bg-darker);
    padding: 2rem 0;
    border-bottom: 1px solid var(--border);
}

.filter-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.filter-btn:hover {
    background: var(--primary);
    color: var(--text-primary);
    border-color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    color: var(--text-primary);
    border-color: var(--primary);
}

/* Gallery Content */
.gallery-content {
    padding: 4rem 0;
    background: var(--bg-dark);
}

/* Carousel Container */
.carousel-container {
    max-width: 1200px;
    margin: 0 auto 4rem;
    position: relative;
}

.carousel-wrapper {
    position: relative;
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
}

.carousel-slides {
    position: relative;
    height: 600px;
    overflow: hidden;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-slide.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.carousel-slide.prev {
    transform: translateX(-100%);
}

.slide-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    height: 100%;
    gap: 0;
}

.video-container,
.image-container {
    position: relative;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.video-container video,
.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    display: block;
}

.video-container video {
    max-height: 600px;
}

/* Simple Video Container */
.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    cursor: pointer;
}

.video-container video {
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: block;
}

/* Custom play button overlay */
.video-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.video-container:hover::after {
    background: rgba(0, 0, 0, 0.4);
}

.video-container::before {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    color: white;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 3;
    pointer-events: none;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.video-container:hover::before {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

/* Hide custom overlay when video is playing */
.video-container.playing::before,
.video-container.playing::after {
    opacity: 0;
    pointer-events: none;
}

.video-container.playing {
    cursor: default;
}

.slide-info {
    padding: 3rem;
    background: var(--bg-darker);
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 1px solid var(--border);
}

.slide-info h3 {
    color: var(--text-primary);
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.slide-info p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.slide-tags {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tag {
    padding: 0.5rem 1rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag.interface1 {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.tag.interface2 {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.tag.interface3 {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.tag.demos {
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.tag.photos {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

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

.carousel-nav:hover {
    background: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

.carousel-nav.prev {
    left: 20px;
}

.carousel-nav.next {
    right: 20px;
}

/* Carousel Indicators */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 2rem;
    padding: 0 2rem;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.indicator.active {
    background: var(--primary);
    transform: scale(1.2);
}

.indicator:hover {
    background: var(--accent);
}

/* Thumbnail Gallery - Sleek Hidden Design */
.thumbnail-gallery {
    position: relative;
    margin-bottom: 2rem;
    opacity: 0.7;
    transition: all 0.4s ease;
}

.thumbnail-gallery:hover {
    opacity: 1;
}

.thumbnail-gallery h3 {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    text-align: center;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.thumbnail-grid {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    max-height: 80px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.25rem 0.5rem;
    scroll-behavior: auto;
}

.thumbnail {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    position: relative;
    flex-shrink: 0;
    opacity: 0.6;
}

.thumbnail:hover {
    transform: scale(1.1);
    border-color: var(--primary);
    opacity: 1;
}

.thumbnail.active {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.4);
    opacity: 1;
    transform: scale(1.05);
}

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

.thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    opacity: 1;
    transition: opacity 0.3s ease;
}

.thumbnail:hover::after,
.thumbnail.active::after {
    opacity: 0;
}

/* Gallery Description */
.gallery-description {
    text-align: center;
    background: var(--bg-card);
    padding: 3rem;
    border-radius: 15px;
    border: 1px solid var(--border);
}

.gallery-description h2 {
    color: var(--text-primary);
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.gallery-description p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto 3rem;
}

/* Interface Legend */
.interface-legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-darker);
    border-radius: 10px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.legend-item:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-color.interface1 {
    background: #3b82f6;
}

.legend-color.interface2 {
    background: #10b981;
}

.legend-color.interface3 {
    background: #f59e0b;
}

.legend-color.demos {
    background: #8b5cf6;
}

.legend-color.photos {
    background: #6366f1;
}

.legend-item span:last-child {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .carousel-slides {
        height: 500px;
    }
    
    .slide-content {
        grid-template-columns: 1fr;
        grid-template-rows: 2fr 1fr;
    }
    
    .slide-info {
        padding: 2rem;
        border-left: none;
        border-top: 1px solid var(--border);
    }
    
    .slide-info h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .gallery-title {
        font-size: 2rem;
    }
    
    .carousel-slides {
        height: 400px;
    }
    
    .slide-info {
        padding: 1.5rem;
    }
    
    .slide-info h3 {
        font-size: 1.3rem;
    }
    
    .slide-info p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .carousel-nav {
        width: 40px;
        height: 40px;
    }
    
    .carousel-nav.prev {
        left: 10px;
    }
    
    .carousel-nav.next {
        right: 10px;
    }
    
    .thumbnail-grid {
        gap: 0.3rem;
    }
    
    .thumbnail {
        width: 50px;
        height: 50px;
    }
    
    .interface-legend {
        grid-template-columns: 1fr;
    }
    
    .filter-buttons {
        justify-content: flex-start;
        overflow-x: auto;
        padding: 0 1rem;
    }
    
    .filter-btn {
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .carousel-slides {
        height: 350px;
    }
    
    .slide-content {
        grid-template-rows: 1.5fr 1fr;
    }
    
    .slide-info {
        padding: 1rem;
    }
    
    .gallery-description {
        padding: 2rem 1rem;
    }
    
    .filter-buttons {
        gap: 0.5rem;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

/* Loading States */
.carousel-slide video,
.carousel-slide img {
    transition: opacity 0.3s ease;
}

.carousel-slide video[data-loading="true"],
.carousel-slide img[data-loading="true"] {
    opacity: 0.5;
}

/* Custom Scrollbar for Thumbnail Grid */
.thumbnail-grid::-webkit-scrollbar {
    width: 6px;
}

.thumbnail-grid::-webkit-scrollbar-track {
    background: var(--bg-darker);
    border-radius: 3px;
}

.thumbnail-grid::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.thumbnail-grid::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}