/**
 * Gorilla Team Fan Carousel Styles
 * Deck of cards fan effect for team member showcase
 */

/* Wrapper */
.gtfc-carousel-wrapper {
    position: relative;
    width: 100%;
    padding: 60px 80px 80px;
    overflow: visible;
    box-sizing: border-box;
}

/* Carousel container */
.gtfc-carousel {
    --fan-spread: 15deg;
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    min-height: 350px;
    perspective: 1000px;
}

/* Cards container - handles the fan layout */
.gtfc-cards-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    width: 100%;
    transform-style: preserve-3d;
}

/* Individual card */
.gtfc-card {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: center bottom;
    cursor: pointer;
    will-change: transform;
    backface-visibility: hidden;
}

/* Card fan positioning - using CSS custom properties for dynamic calculation */
.gtfc-card[data-position="-4"] { --pos: -4; z-index: 1; opacity: 0.3; }
.gtfc-card[data-position="-3"] { --pos: -3; z-index: 2; opacity: 0.5; }
.gtfc-card[data-position="-2"] { --pos: -2; z-index: 3; opacity: 0.7; }
.gtfc-card[data-position="-1"] { --pos: -1; z-index: 4; opacity: 0.85; }
.gtfc-card[data-position="0"] { --pos: 0; z-index: 5; opacity: 1; }
.gtfc-card[data-position="1"] { --pos: 1; z-index: 4; opacity: 0.85; }
.gtfc-card[data-position="2"] { --pos: 2; z-index: 3; opacity: 0.7; }
.gtfc-card[data-position="3"] { --pos: 3; z-index: 2; opacity: 0.5; }
.gtfc-card[data-position="4"] { --pos: 4; z-index: 1; opacity: 0.3; }

/* Apply the fan transform */
.gtfc-card[data-position] {
    transform: 
        translateX(calc(var(--pos) * 60px))
        rotate(calc(var(--pos) * var(--fan-spread)))
        translateY(calc(var(--pos) * var(--pos) * 8px));
}

/* Center card lift on hover */
.gtfc-card[data-position="0"]:hover {
    transform: 
        translateX(0)
        rotate(0deg)
        translateY(-15px)
        scale(1.05);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

/* Hidden cards (outside visible range) */
.gtfc-card.gtfc-hidden {
    opacity: 0 !important;
    pointer-events: none;
    visibility: hidden;
}

/* Card image wrapper */
.gtfc-card-image-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    border-radius: 50%;
    transition: border-color 0.3s ease, border-width 0.3s ease, border-radius 0.3s ease, background-color 0.3s ease;
}

/* Hover image support */
.gtfc-card-image-wrapper.has-hover-image {
    position: relative;
}

.gtfc-card-image-wrapper.has-hover-image .gtfc-card-image-default {
    display: block;
    transition: opacity 0.3s ease;
}

.gtfc-card-image-wrapper.has-hover-image .gtfc-card-image-hover {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    object-position: center bottom;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gtfc-card:hover .gtfc-card-image-wrapper.has-hover-image .gtfc-card-image-default {
    opacity: 0;
}

.gtfc-card:hover .gtfc-card-image-wrapper.has-hover-image .gtfc-card-image-hover {
    opacity: 1;
}

/* Card image */
.gtfc-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
    transition: transform 0.3s ease, border-radius 0.3s ease;
}

.gtfc-card:hover .gtfc-card-image {
    transform: scale(1.02);
}

/* Card content */
.gtfc-card-content {
    padding: 0 5px 5px;
}

/* Card name */
.gtfc-card-name {
    margin: 0 0 5px;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
    transition: color 0.3s ease;
}

/* Card title */
.gtfc-card-title {
    margin: 0;
    font-size: 14px;
    color: #666666;
    line-height: 1.4;
    transition: color 0.3s ease;
}

/* Navigation buttons */
.gtfc-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: #ffffff;
    color: #333333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    z-index: 100;
}

.gtfc-nav-btn:hover {
    background: #333333;
    color: #ffffff;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.gtfc-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.gtfc-nav-prev {
    left: 10px;
}

.gtfc-nav-next {
    right: 10px;
}

.gtfc-nav-btn svg {
    width: 24px;
    height: 24px;
}

/* Dots navigation */
.gtfc-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
    padding-top: 20px;
}

.gtfc-dot {
    width: 12px;
    height: 12px;
    border: none;
    border-radius: 50%;
    background: #cccccc;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.gtfc-dot:hover {
    background: #999999;
    transform: scale(1.2);
}

.gtfc-dot.active {
    background: #333333;
    transform: scale(1.3);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .gtfc-carousel-wrapper {
        padding: 50px 60px 70px;
    }
    
    .gtfc-carousel {
        min-height: 300px;
    }
    
    .gtfc-card[data-position] {
        transform: 
            translateX(calc(var(--pos) * 50px))
            rotate(calc(var(--pos) * var(--fan-spread)))
            translateY(calc(var(--pos) * var(--pos) * 6px));
    }
}

@media (max-width: 768px) {
    .gtfc-carousel-wrapper {
        padding: 40px 50px 60px;
    }
    
    .gtfc-carousel {
        min-height: 280px;
        --fan-spread: 12deg;
    }
    
    .gtfc-card[data-position] {
        transform: 
            translateX(calc(var(--pos) * 40px))
            rotate(calc(var(--pos) * var(--fan-spread)))
            translateY(calc(var(--pos) * var(--pos) * 5px));
    }
    
    .gtfc-nav-btn {
        width: 40px;
        height: 40px;
    }
    
    .gtfc-nav-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .gtfc-nav-prev {
        left: 5px;
    }
    
    .gtfc-nav-next {
        right: 5px;
    }
}

@media (max-width: 480px) {
    .gtfc-carousel-wrapper {
        padding: 30px 40px 50px;
    }
    
    .gtfc-carousel {
        min-height: 260px;
        --fan-spread: 10deg;
    }
    
    .gtfc-card[data-position] {
        transform: 
            translateX(calc(var(--pos) * 30px))
            rotate(calc(var(--pos) * var(--fan-spread)))
            translateY(calc(var(--pos) * var(--pos) * 4px));
    }
    
    .gtfc-card-name {
        font-size: 16px;
    }
    
    .gtfc-card-title {
        font-size: 13px;
    }
}

/* Animation for card transitions */
@keyframes gtfc-card-enter {
    from {
        opacity: 0;
        transform: translateX(100px) rotate(30deg) translateY(50px);
    }
    to {
        opacity: 1;
    }
}

/* Elementor Editor specific styles */
.elementor-editor-active .gtfc-carousel-wrapper {
    min-height: 400px;
}

/* Print styles */
@media print {
    .gtfc-nav-btn,
    .gtfc-dots {
        display: none !important;
    }
    
    .gtfc-card {
        position: relative !important;
        transform: none !important;
        opacity: 1 !important;
        display: inline-block;
        margin: 10px;
        page-break-inside: avoid;
    }
    
    .gtfc-cards-container {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
}
