/* =========================================================
   THEME 1: Old Classic Grid Layout
   ========================================================= */
#instagram-feed.ig-theme-1 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}
.ig-theme-1 .ig-item {
    display: block;
}
.ig-theme-1 .ig-item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

/* =========================================================
   THEME 2: Profile Header + Carousel + Hover Video + Like
   ========================================================= */
#instagram-feed.ig-theme-2 {
    max-width: 1260px;
    margin: 0 auto;
    padding: 28px 20px 40px;
}

/* Profile Header */
.ig2-header {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px 36px;
    margin-bottom: 24px;
}
.ig2-profile {
    display: flex;
    align-items: center;
    gap: 14px;
}
.ig2-avatar-ring {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    padding: 2.5px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    flex-shrink: 0;
}
.ig2-avatar-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #fff;
    padding: 2px;
    overflow: hidden;
}
.ig2-avatar-inner img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.ig2-user-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ig2-username-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    text-decoration: none;
}
.ig2-username-row:hover {
    text-decoration: underline;
}
.ig2-verified {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}
.ig2-fullname {
    font-size: 13px;
    color: #4b5563;
    font-weight: 400;
}

.ig2-stats {
    display: flex;
    align-items: center;
    gap: 24px;
}
.ig2-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.25;
}
.ig2-stat strong {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}
.ig2-stat span {
    font-size: 13px;
    color: #6b7280;
}

.ig2-follow-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #4f67f6;
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px;
    transition: background-color 0.2s ease, transform 0.15s ease;
}
.ig2-follow-btn:hover {
    background: #3d54e0;
    transform: translateY(-1px);
}

/* Carousel */
.ig2-carousel-wrap {
    position: relative;
}
.ig2-track {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px 2px;
}
.ig2-track::-webkit-scrollbar {
    display: none;
}

.ig2-card {
    position: relative;
    flex: 0 0 calc((100% - 56px) / 5);
    aspect-ratio: 4 / 4.8;
    border-radius: 10px;
    overflow: hidden;
    background: #111827;
    scroll-snap-align: start;
    text-decoration: none;
    display: block;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}
.ig2-card img.ig2-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}
.ig2-card:hover img.ig2-thumb {
    transform: scale(1.03);
}
.ig2-card video.ig2-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.22s ease;
    pointer-events: none;
    background: transparent;
}
.ig2-card.is-playing video.ig2-video {
    opacity: 1;
}

/* Top-right Video / Carousel badge */
.ig2-type-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.55));
    pointer-events: none;
}

/* Bottom Action Bar (Like + Mute) */
.ig2-overlay {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 3;
    padding: 28px 10px 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.ig2-like-btn,
.ig2-mute-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease;
}
.ig2-like-btn:hover,
.ig2-mute-btn:hover {
    background: rgba(0, 0, 0, 0.72);
    transform: scale(1.05);
}
.ig2-like-btn svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: #ffffff;
    stroke-width: 2;
    transition: transform 0.2s ease, fill 0.2s ease, stroke 0.2s ease;
}
.ig2-like-btn.is-liked svg {
    fill: #ff3040;
    stroke: #ff3040;
    transform: scale(1.15);
}
.ig2-mute-btn {
    padding: 5px 8px;
    opacity: 0;
    transition: opacity 0.2s ease, background-color 0.2s ease;
}
.ig2-card:hover .ig2-mute-btn,
.ig2-card.is-playing .ig2-mute-btn {
    opacity: 1;
}

/* Carousel Arrow Buttons */
.ig2-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #ffffff;
    color: #111827;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease, transform 0.15s ease;
}
.ig2-nav-btn:hover {
    transform: translateY(-50%) scale(1.06);
}
.ig2-nav-btn.is-hidden {
    opacity: 0;
    pointer-events: none;
}
.ig2-nav-prev {
    left: -14px;
}
.ig2-nav-next {
    right: -14px;
}

/* Responsive breakpoints for 5 -> 4 -> 3 -> 2 cards */
@media (max-width: 1100px) {
    .ig2-card { flex: 0 0 calc((100% - 42px) / 4); }
}
@media (max-width: 860px) {
    .ig2-card { flex: 0 0 calc((100% - 28px) / 3); }
}
@media (max-width: 580px) {
    .ig2-header { gap: 16px; }
    .ig2-card { flex: 0 0 calc((100% - 14px) / 2); }
    .ig2-nav-prev { left: 4px; }
    .ig2-nav-next { right: 4px; }
}