/**
 * Instagram Video Showcase - Frontend Styles
 */

.ivs-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.ivs-videos-wrapper {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 10px !important;
    align-items: flex-start;
}

.ivs-video-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    display: block !important;
}

.ivs-video-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.ivs-video-link {
    display: block;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.ivs-video-embed {
    position: relative;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.ivs-video-embed video {
    width: 100%;
    height: auto;
    display: block;
}

/* Instagram blockquote */
.ivs-video-embed .instagram-media {
    margin: 0 !important;
    padding: 0 !important;
    min-width: 100% !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* Instagram iframe içindeki header ve footer'ı gizle */
.ivs-video-embed iframe {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
}

/* Instagram embed header (profil gör butonu) gizle */
.ivs-video-embed .instagram-media iframe {
    margin-top: -56px !important;
    height: calc(100% + 200px) !important;
}

/* Video overlay hover efekti */
.ivs-video-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.ivs-video-item:hover::before {
    background: rgba(0, 0, 0, 0.05);
}

/* Video başlığı - altta stats'ın üstünde */
.ivs-video-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    color: white;
}

/* Ses açma/kapatma butonu */
.ivs-sound-toggle {
    background: transparent !important;
    border: none;
    outline: none;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: opacity 0.3s ease;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    color: white;
}

.ivs-sound-toggle:hover {
    opacity: 0.8;
    background: transparent !important;
}

.ivs-sound-toggle:focus {
    outline: none;
    background: transparent !important;
}

.ivs-sound-toggle:active {
    background: transparent !important;
}

.ivs-sound-toggle svg {
    width: 20px;
    height: 20px;
    fill: white;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
}

/* Video bilgi overlay */
.ivs-video-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0px 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.7) 60%, transparent 100%);
    color: white;
    z-index: 3;
    pointer-events: none;
}

.ivs-video-info .ivs-sound-toggle {
    pointer-events: auto;
}

.ivs-video-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.ivs-stats-left {
    display: flex;
    gap: 15px;
    align-items: center;
}

.ivs-video-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.ivs-video-stat svg {
    width: 16px;
    height: 16px;
    fill: white;
}

/* Play icon overlay - artık hover'da görünmeyecek */
.ivs-video-item::after {
    display: none;
}

/* Responsive tasarım */
@media (max-width: 1024px) {
    .ivs-container {
        padding: 10px;
        overflow-x: hidden;
    }
    
    .ivs-videos-wrapper {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 15px !important;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 10px;
        grid-template-columns: none !important;
    }
    
    .ivs-videos-wrapper::-webkit-scrollbar {
        display: none;
    }
    
    .ivs-videos-wrapper::-webkit-scrollbar-track {
        display: none;
    }
    
    .ivs-videos-wrapper::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.3);
        border-radius: 4px;
    }
    
    .ivs-videos-wrapper::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 0, 0, 0.5);
    }
    
    .ivs-video-item {
        flex: 0 0 calc(50% - 10px);
        min-width: calc(50% - 10px);
        max-width: calc(50% - 10px);
        scroll-snap-align: start;
    }
    
    /* Kaydırma göstergesi - gizli */
    .ivs-container::after {
        display: none;
    }
    
    @keyframes fadeInOut {
        0%, 100% { opacity: 0.3; }
        50% { opacity: 1; }
    }
}

@media (max-width: 768px) {
    .ivs-container {
        padding: 0 !important;
        margin: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        overflow-x: scroll;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .ivs-container::-webkit-scrollbar {
        display: none;
    }
    
    .ivs-videos-wrapper {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        width: auto !important;
        padding: 10px 0 10px 8px !important;
        margin: 0 !important;
    }
    
    .ivs-video-item:first-child {
        margin-left: 0 !important;
    }
    
    .ivs-video-item:last-child {
        margin-right: 8px !important;
    }
    
    .ivs-video-item {
        flex: 0 0 calc(50vw - 12px) !important;
        width: calc(50vw - 12px) !important;
        min-width: calc(50vw - 12px) !important;
        max-width: calc(50vw - 12px) !important;
    }
    
    .ivs-video-info {
        padding: 0px 10px;
    }
    
    .ivs-video-title {
        font-size: 12px;
    }
    
    .ivs-video-stats {
        font-size: 11px;
    }
    
    .ivs-stats-left {
        gap: 10px;
    }
    
    .ivs-video-stat svg {
        width: 16px;
        height: 16px;
    }
    
    .ivs-sound-toggle svg {
        width: 18px;
        height: 18px;
    }
}

/* Loading state */
.ivs-video-item.loading {
    background: #f0f0f0;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ivs-video-item.loading::before {
    content: 'Yükleniyor...';
    color: #666;
    font-size: 14px;
}

/* Error state */
.ivs-video-item.error {
    background: #fee;
    border: 1px solid #fcc;
    padding: 20px;
    text-align: center;
    color: #c00;
}
