.gallery {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
    height: 500px;
}

.gallery-container {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    height: 100%;
    position: relative;
    width: 100%;
}

.gallery-item {
    position: absolute;
    width: 400px;
    height: 450px;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(0.8);
    opacity: 0;
    visibility: hidden;
}

.card {
    border-radius: 15px;
    overflow: hidden;
    height: 100%;
    background: transparent;
    position: relative;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.img-grad {
    height: 100%;
    position: relative;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 15px;
}

.card-img-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.3));
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 25px;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-title {
    color: #fff;
    margin-bottom: 15px;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-text {
    color: #fff;
    font-size: 14px;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 15px;
}

.btn-arrow {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Active and surrounding items */
.gallery-item-1 {
    transform: translateX(-100%) scale(0.8);
    opacity: 1;
    z-index: 1;
    visibility: visible;
}

.gallery-item-2 {
    transform: translateX(0) scale(1);
    opacity: 1;
    z-index: 3;
    visibility: visible;
}

.gallery-item-3 {
    transform: translateX(100%) scale(0.8);
    opacity: 1;
    z-index: 1;
    visibility: visible;
}

/* Hover effects for all cards */
.gallery-item:hover .card-img-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.95), rgba(0,0,0,0.5));
}

.gallery-item:hover .card-text,
.gallery-item:hover .btn-arrow {
    opacity: 1;
    transform: translateY(0);
}

/* Controls */
.gallery-controls {
    position: absolute;
    width: 110%;
    top: 50%;
    left: -5%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    z-index: 4;
}

.gallery-controls button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    cursor: pointer;
    padding: 15px;
    border-radius: 50%;
    opacity: 0.7;
    transition: all 0.3s ease;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-controls button img {
    width: 20px;
    height: 20px;
}

.gallery-item .card-img-overlay {
  color: #fff;
  display: block !important;
  align-content: center;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .gallery {
        height: 400px;
        padding: 10px 0;
    }

    .gallery-item {
        width: 320px;
        height: 350px;
    }

    .gallery-controls {
        width: 100%;
        left: 0;
    }
}

@media (max-width: 768px) {
    .gallery {
        height: 400px;
    }

    .gallery-item {
        width: 300px;
        height: 380px;
        visibility: hidden; /* Hide all items by default */
        opacity: 0;
        transition: all 0.4s ease-in-out;
    }
    
    /* Only show center item */
    .gallery-item-2 {
        visibility: visible;
        opacity: 1;
        transform: translateX(0) scale(1);
    }

    /* Hide side items completely */
    .gallery-item-1,
    .gallery-item-3 {
        visibility: hidden;
        opacity: 0;
        transform: scale(0.8);
    }

    .card-text {
        font-size: 13px;
        margin-bottom: 10px;
        opacity: 1;
        transform: none;
    }

    .card-title {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .card-img-overlay {
        padding: 20px;
        background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.4));
    }

    .btn-arrow {
        opacity: 1;
        transform: none;
    }

    /* Adjust controls for mobile */
    .gallery-controls {
        width: 100%;
        left: 0;
    }

    .gallery-controls button {
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.3);
    }
}

@media (max-width: 576px) {
    .gallery {
        height: 350px;
    }

    .gallery-item {
        width: 260px;
        height: 330px;
    }

    .card-text {
        font-size: 12px;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        display: -webkit-box;
    }

    .card-title {
        font-size: 16px;
    }

    .card-img-overlay {
        padding: 15px;
    }
}

@media (max-width: 360px) {
    .gallery {
        height: 300px;
    }

    .gallery-item {
        width: 220px;
        height: 280px;
    }

    .card-text {
        font-size: 11px;
        -webkit-line-clamp: 2;
    }

    .card-title {
        font-size: 14px;
    }
} 