
:root {
    --insta-bg: #000000;
    --insta-card-bg: #0b0b0c;
    --insta-text: #ffffff;
    --insta-text-muted: #a0a0a0;
    --insta-gold: #D5BE6E;
    --insta-gold-hover: #caaf54;
    --insta-transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Section Container */
.insta-reels-section {
    background-color: var(--insta-bg);
    padding: 100px 0;
    position: relative;
    overflow: hidden;
    width: 100%;
    border-top: 1px solid rgba(213, 190, 110, 0.1);
    border-bottom: 1px solid rgba(213, 190, 110, 0.1);
}

.insta-reels-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

/* Header Styling */
.insta-reels-header {
    text-align: center;
    margin-bottom: 60px;
}

.insta-reels-subtitle {
    display: block;
    color: var(--insta-gold);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 3px;
    margin-bottom: 15px;
    text-transform: uppercase;
    font-family: "Jost", sans-serif;
}

.insta-reels-title {
    font-family: "Forum", serif;
    font-size: 52px;
    font-weight: 400;
    letter-spacing: 2px;
    color: var(--insta-text);
    text-transform: uppercase;
    margin: 0;
}

/* Layout Track */
.insta-reels-track {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 24px;
    width: 100%;
}

/* Reel Card Styling */
.insta-reels-card {
    background-color: var(--insta-card-bg);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 9 / 16;
    width: 100%;
    border: 1px solid rgba(213, 190, 110, 0.1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    transition: var(--insta-transition);
}

/* Video Container & Video Element */
.insta-reels-video-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.insta-reels-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background-color: #000;
    border: none;
}

/* Card Hover Effects (Desktop Only) */
@media (min-width: 1025px) {
    .insta-reels-card:hover {
        transform: translateY(-8px);
        border-color: rgba(213, 190, 110, 0.4);
        box-shadow: 0 20px 40px rgba(213, 190, 110, 0.15);
    }
}

/* Top Bar Overlay */
.insta-reels-top-bar {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    pointer-events: auto;
}

.insta-reels-badge-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--insta-text);
    font-size: 18px;
    text-decoration: none;
    transition: var(--insta-transition);
}

.insta-reels-badge-link:hover {
    background: var(--insta-gold);
    color: #141416;
    transform: scale(1.1) rotate(10deg);
    border-color: var(--insta-gold);
    box-shadow: 0 0 15px rgba(213, 190, 110, 0.4);
}

/* Side Action Buttons (Like, Comment, Share) */
.insta-reels-side-actions {
    position: absolute;
    right: 12px;
    bottom: 90px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.insta-reels-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.insta-reels-action-btn {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--insta-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    transition: var(--insta-transition);
    text-decoration: none;
}

.insta-reels-action-btn:hover {
    background: #fff;
    color: #000;
    transform: scale(1.1);
    border-color: #fff;
}

.insta-reels-action-btn.liked {
    color: #ff3040;
    background: rgba(255, 48, 64, 0.1);
    border-color: rgba(255, 48, 64, 0.5);
    animation: heartPop 0.3s ease-out;
}

.insta-reels-action-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--insta-text);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    font-family: "Inter", sans-serif;
}

/* Bottom Content Overlay (Username & Caption) */
.insta-reels-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 60px 20px 16px; /* Extra padding-right to clear side actions */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.5) 60%, transparent 100%);
    z-index: 5;
    pointer-events: none; /* Let clicks pass through to the video */
}

.insta-reels-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    pointer-events: auto; /* Re-enable clicks for profile link */
}

.insta-reels-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid var(--insta-gold);
    object-fit: cover;
}

.insta-reels-username {
    font-size: 13px;
    font-weight: 700;
    color: var(--insta-text);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    font-family: "Jost", sans-serif;
}

.insta-reels-caption {
    font-size: 12px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    margin: 0;
    font-family: "Inter", sans-serif;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    pointer-events: auto;
}

/* Double Tap Heart Pop */
.insta-reels-double-tap-heart {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    color: #ff3040;
    font-size: 70px;
    z-index: 15;
    pointer-events: none;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    animation: doubleTapHeart 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Heart animations */
@keyframes heartPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

@keyframes doubleTapHeart {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    15% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.9; }
    30% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    80% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
}

/* Responsive / Mobile Design (Mobile-First / Max Widths) */
@media (max-width: 1024px) {
    .insta-reels-section {
        padding: 60px 0;
    }
    
    .insta-reels-title {
        font-size: 40px;
    }

    .insta-reels-track {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 767px) {
    .insta-reels-container {
        padding: 0; /* Remove container padding so swipe is edge-to-edge */
    }

    .insta-reels-header {
        padding: 0 20px;
        margin-bottom: 40px;
    }

    .insta-reels-track {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 16px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding: 10px 24px 30px 24px; /* Bottom padding to clear card shadow */
        scrollbar-width: none; /* Hide scrollbar Firefox */
        -ms-overflow-style: none; /* Hide scrollbar IE/Edge */
        -webkit-overflow-scrolling: touch; /* Momentum scrolling iPhone */
    }

    .insta-reels-track::-webkit-scrollbar {
        display: none; /* Hide scrollbar Chrome/Safari */
    }

    .insta-reels-card {
        flex: 0 0 85%; /* One reel mostly visible, hinting next reel */
        width: 85%;
        scroll-snap-align: center;
        aspect-ratio: 9 / 16;
    }
    
    .insta-reels-overlay {
        padding-bottom: 24px; /* Push caption slightly up on mobile */
    }
}
