/* Instagram Reels Section Styles */
.instagram-reels-section {
    padding: 90px 0;
    background-color: #f9f9f9;
    overflow: hidden;
}

.instagram-reels-container {
    position: relative;
    padding: 0 40px;
    width: 100%;
    overflow: visible; /* Container'ın taşması durumunda içeriğin görünmesini sağlar */
}

.instagram-reels-slider {
    display: flex;
    /* overflow-x: hidden; - Bu özelliği kaldırıyoruz çünkü slider'ın kaymasını engelliyor */
    scroll-behavior: smooth;
    margin: 0 -15px;
    position: relative;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    /* overflow: hidden; - Bu özelliği de kaldırıyoruz */
}

.instagram-reel-item {
    flex: 0 0 auto;
    width: calc(25% - 30px);
    margin: 0 15px;
    transition: all 0.3s ease;
}

/* For mobile devices */
@media (max-width: 767px) {
    .instagram-reel-item {
        width: calc(100% - 30px);
    }
}

/* For tablets */
@media (min-width: 768px) and (max-width: 991px) {
    .instagram-reel-item {
        width: calc(50% - 30px);
    }
}

.instagram-reel-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    background-color: #000;
    margin-bottom: 15px;
    /* Portrait/vertical format (9:16 aspect ratio) */
    padding-bottom: 177.78%; /* 16:9 inverted = 9:16 = 16/9 * 100% */
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
    transition: transform 0.3s ease-in-out;
}

.instagram-reel-wrapper:hover {
    transform: scale(1.02);
}

.instagram-reel-wrapper:hover .video-controls {
    opacity: 1;
}

.instagram-reel-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-controls {
    position: absolute;
    top: calc(50% - 30px);
    left: calc(50% - 30px);
    opacity: 1;
    transition: opacity 0.3s ease;
    z-index: 999;
    display: block;
    width: 60px;
    height: 60px;
}

.play-pause-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.9);
    color: #000;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.1;
}

.instagram-reel-wrapper:hover .play-pause-btn {
    opacity: 1;
}

.play-pause-btn:hover {
    background-color: #fff;
}

.play-pause-btn i {
    font-size: 24px;
    color: #000;
}

.play-pause-btn .fa-pause {
    display: none;
}

.play-pause-btn.playing .fa-play {
    display: none;
}

.play-pause-btn.playing .fa-pause {
    display: inline-block;
}

.instagram-reel-caption {
    padding: 15px 0;
    text-align: left;
}

.instagram-reel-caption h4 {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
}

.instagram-link {
    display: flex;
    align-items: center;
    color: #666;
    font-size: 14px;
    transition: color 0.3s ease;
    text-decoration: none;
}

.instagram-link:hover {
    color: #000;
}

.instagram-link .instagram-icon {
    margin-right: 8px;
    font-size: 18px;
}

.instagram-reels-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    padding: 0 20px;
    z-index: 10;
}

.reels-prev-btn,
.reels-next-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.reels-prev-btn:hover,
.reels-next-btn:hover {
    background: #fff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.reels-prev-btn i,
.reels-next-btn i {
    font-size: 20px;
    color: #000;
}

.reels-prev-btn {
    margin-left: -20px;
}

.reels-next-btn {
    margin-right: -20px;
}

/* Playing state indicator */
.instagram-reel-item.is-playing .instagram-reel-wrapper:after {
    content: '';
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 10px;
    height: 10px;
    background-color: #e1306c; /* Instagram color */
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(225, 48, 108, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(225, 48, 108, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(225, 48, 108, 0);
    }
}

/* Back button for mobile view */
.instagram-back-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.instagram-back-btn:hover {
    background-color: #fff;
}