/* speakers-creative.css - Optimized for smooth carousel performance */

.bg-black2 {
    background-color: #1d1e1e !important;
}

.carousel-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #1d1e1e;
    padding: 30px 0;
}

/* Side Gradients - Stronger fade for better effect */
.carousel-fade {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 15%;
    z-index: 25;
    pointer-events: none;
}

.fade-left {
    left: 0;
    background: linear-gradient(to right, 
        #1d1e1e 0%, 
        rgba(29, 30, 30, 0.9) 30%, 
        rgba(29, 30, 30, 0.5) 70%, 
        transparent 100%);
}

.fade-right {
    right: 0;
    background: linear-gradient(to left, 
        #1d1e1e 0%, 
        rgba(29, 30, 30, 0.9) 30%, 
        rgba(29, 30, 30, 0.5) 70%, 
        transparent 100%);
}

.carousel-container {
    display: flex;
    width: 100%;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

/* Mobile only - show grab cursor */
@media (max-width: 768px) {
    .carousel-container {
        cursor: grab;
    }
    
    .carousel-container:active {
        cursor: grabbing;
    }
}

.carousel-track {
    display: flex;
    gap: 40px;
    will-change: transform;
}

.speaker-slide {
    min-width: 300px;
    flex-shrink: 0;
    position: relative;
}

/* CHANGE #3: Placeholder cards - Desktop only */
.placeholder-card {
    pointer-events: none;
    opacity: 0.4;
}

.placeholder-bg {
    position: absolute;
    inset: -20px;
    background-image: url('../img/speakers-bg.png');
    background-size: 1200px auto;
    background-color: #2748cb;
    background-position: center center;
    z-index: 1;
}

.placeholder-card .visual-wrapper {
    background: #111;
}

/* Don't apply hover effects to placeholder cards */
.placeholder-card:hover .placeholder-bg {
    transform: none;
}

@media (max-width: 768px) {
    .placeholder-card {
        display: none !important;
    }
}

.visual-wrapper {
    position: relative;
    width: 300px;
    height: 380px;
    border-radius: 20px;
    overflow: hidden;
    background: #111;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    /* Containment for performance */
    contain: layout style paint;
}

/* Dynamic Background with Parallax Effect */
.dynamic-bg {
    position: absolute;
    inset: -20px;
    background-image: url('../img/speakers-bg.png');
    background-size: 1200px auto;
    background-color: #2748cb;
    background-position: center center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                background-position 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    /* Keep background stable during transitions */
    will-change: transform, background-position;
}

/* Speaker Image - Prevent flash with preloading */
.speaker-cutout {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: auto;
    z-index: 2;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* Force image to stay loaded */
    will-change: transform;
}

/* Mobile-specific image optimization */
@media (max-width: 768px) {
    .speaker-cutout {
        /* Prevent image from being unloaded */
        content-visibility: auto;
        contain-intrinsic-size: 300px 400px;
    }
}

/* Name Tag: Gradient Overlay with Smooth Animation */
.name-tag {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    display: flex;
    align-items: flex-end;
    padding: 30px 20px;
    background: linear-gradient(to top, 
        #2c52d2 0%, 
        rgba(44, 82, 210, 0.9) 15%, 
        rgba(44, 82, 210, 0.6) 40%, 
        transparent 100%);
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.name-tag h3 {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease-in-out;
}

/* Desktop: Language-based alignment */
@media (min-width: 769px) {
    [dir="ltr"] .name-tag { 
        text-align: left; 
        justify-content: flex-start; 
    }
    
    [dir="rtl"] .name-tag { 
        text-align: right; 
        justify-content: flex-end; 
    }
    
    /* Hover Effects - Desktop Only */
    .speaker-slide:not(.placeholder-card):hover .name-tag { 
        opacity: 1; 
    }
    
    .speaker-slide:not(.placeholder-card):hover .dynamic-bg { 
        transform: scale(1.12);
        background-position: center bottom !important;
    }
    
    .speaker-slide:not(.placeholder-card):hover .speaker-cutout {
        transform: translateX(-50%) scale(1.05);
    }
    
    .speaker-slide:not(.placeholder-card):hover .name-tag h3 {
        transform: translateY(-3px);
    }
}

/* Mobile: Always show name, centered */
@media (max-width: 768px) {
    .name-tag { 
        opacity: 1; 
        justify-content: center !important; 
        text-align: center !important;
        padding: 20px 15px;
    }
    
    .name-tag h3 {
        font-size: 1.1rem;
    }
    
    .carousel-fade {
        width: 12%;
    }
    
    .carousel-wrapper {
        padding: 20px 0;
    }
}

/* Navigation Buttons */
.nav-circle-btn {
    width: 50px; 
    height: 50px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    cursor: pointer;
    display: flex; 
    align-items: center; 
    justify-content: center;
    transition: all 0.25s ease;
    -webkit-tap-highlight-color: transparent;
    outline: none;
      user-select: none;
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* IE10+/Edge */
}

.nav-circle-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-circle-btn img { 
    width: 20px; 
    height: auto;
    pointer-events: none;
    transition: filter 0.25s ease, transform 0.25s ease;
}

/* CHANGE #2: Updated hover colors - #fd6001 background, #fffff5 arrow */
.nav-circle-btn:hover:not(.disabled) { 
    background: #fd6001;
    border-color: #fd6001;
    transform: scale(1.05);
}

.nav-circle-btn:hover:not(.disabled) img { 
    filter: brightness(0) saturate(100%) invert(99%) sepia(5%) saturate(368%) hue-rotate(321deg) brightness(104%) contrast(100%);
    transform: scale(1.1);
}

.nav-circle-btn:active:not(.disabled) {
    transform: scale(0.95);
}

/* Mobile Navigation Container */
.mobile-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 25px;
}

/* Desktop Navigation - Top only */
.desktop-nav {
    display: none;
}

@media (min-width: 769px) {
    .desktop-nav {
        display: flex !important;
    }
    .mobile-nav {
        display: none !important;
    }
}

/* Prevent text selection and unwanted interactions during drag */
.carousel-container * {
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

.carousel-container img {
    pointer-events: none;
}

/* Performance optimizations - Balanced approach */
.carousel-track {
    will-change: transform;
}

.speaker-slide {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.visual-wrapper {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Prevent layout thrashing */
.carousel-container img {
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}