/**
 * BakaStudio Instagram Feed Frontend Styles
 */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

.bif-section-wrapper {
    width: 100%;
    padding: 36px 0 44px;
    box-sizing: border-box;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    border-top: 1px solid #eef2f6;
    clear: both;
}

.bif-container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Header */
.bif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 16px;
}

.bif-header-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.bif-insta-gradient-badge {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(220, 39, 67, 0.35);
    flex-shrink: 0;
}

.bif-header-title {
    margin: 0 0 3px 0;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.25;
}

.bif-header-subtitle {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

.bif-header-subtitle a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.15s;
}

.bif-header-subtitle a:hover {
    color: #e11d48;
}

/* Follow Button */
.bif-btn-follow {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 13.5px;
    font-weight: 700;
    padding: 10px 18px;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(220, 39, 67, 0.32);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.bif-btn-follow:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(220, 39, 67, 0.45);
    opacity: 0.95;
    color: #ffffff !important;
}

/* Posts Grid Layout */
.bif-posts-wrap.bif-layout-grid {
    display: grid;
    grid-template-columns: repeat(var(--bif-cols, 6), 1fr);
    gap: var(--bif-gap, 10px);
}

@media (max-width: 1024px) {
    .bif-posts-wrap.bif-layout-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 600px) {
    .bif-posts-wrap.bif-layout-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Posts Carousel Layout */
.bif-posts-wrap.bif-layout-carousel {
    position: relative;
}

.bif-carousel-track {
    display: flex;
    gap: var(--bif-gap, 10px);
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 0;
}

.bif-carousel-track::-webkit-scrollbar {
    display: none;
}

.bif-layout-carousel .bif-post-item {
    flex: 0 0 calc((100% - (var(--bif-cols, 6) - 1) * var(--bif-gap, 10px)) / var(--bif-cols, 6));
    min-width: 160px;
}

.bif-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: #0f172a;
    font-size: 16px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.bif-carousel-nav:hover {
    background: #0f172a;
    color: #ffffff;
}

.bif-carousel-nav.bif-prev { left: -14px; }
.bif-carousel-nav.bif-next { right: -14px; }

/* Post Item & Box */
.bif-post-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.bif-post-link {
    display: block;
    position: relative;
    text-decoration: none;
    overflow: hidden;
}

.bif-img-box {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f1f5f9;
}

.bif-img-box.bif-ratio-1-1 {
    padding-top: 100%;
}

.bif-img-box.bif-ratio-4-5 {
    padding-top: 125%;
}

.bif-img-box img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}

.bif-post-item:hover .bif-img-box img {
    transform: scale(1.07);
}

/* Hover Overlay */
.bif-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.22s ease;
    z-index: 2;
}

.bif-post-item:hover .bif-overlay {
    opacity: 1;
}

.bif-overlay-stats {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    font-weight: 700;
}

.bif-stat-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.bif-overlay-icon {
    font-size: 22px;
    opacity: 0.9;
}

/* Lightbox Modal */
.bif-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.bif-lightbox-backdrop {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.bif-lightbox-box {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    z-index: 2;
    animation: bifModalPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes bifModalPop {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.bif-lightbox-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: rgba(15, 23, 42, 0.08);
    border: none;
    font-size: 24px;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    color: #0f172a;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.bif-lightbox-close:hover {
    background: rgba(15, 23, 42, 0.18);
}

.bif-lightbox-layout {
    display: flex;
    height: 100%;
    max-height: 85vh;
}

.bif-lightbox-image-wrap {
    flex: 1.2;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.bif-lightbox-image-wrap img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    display: block;
}

.bif-lightbox-sidebar {
    flex: 1;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-y: auto;
    font-family: inherit;
    box-sizing: border-box;
}

.bif-lightbox-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}

.bif-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(45deg, #f09433, #dc2743);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bif-user-text strong {
    font-size: 14px;
    color: #0f172a;
    display: block;
}

.bif-user-sub {
    font-size: 11px;
    color: #64748b;
}

.bif-lightbox-caption {
    margin: 16px 0;
    font-size: 13.5px;
    line-height: 1.6;
    color: #334155;
    flex: 1;
}

.bif-lightbox-metrics {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #64748b;
    padding: 12px 0;
    border-top: 1px solid #f1f5f9;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 16px;
}

.bif-lightbox-metrics span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.bif-btn-insta-view {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 13.5px;
    padding: 12px 18px;
    border-radius: 10px;
    transition: opacity 0.15s;
    text-align: center;
}

.bif-btn-insta-view:hover {
    opacity: 0.92;
    color: #ffffff !important;
}

@media (max-width: 768px) {
    .bif-lightbox-layout {
        flex-direction: column;
    }
    .bif-lightbox-image-wrap {
        max-height: 45vh;
    }
}
