.section-main {
    background: #fff;
}

.new-main-banner {
    position: relative;
    overflow: hidden;
    height: 500px;
}

.new-main-banner .img-full-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.new-main-banner .banner-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    text-align: center;
    z-index: 2;
}

.reels-home {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

/* Container Padding */

.latest-article {
    padding: 20px 0;
}

.latest-article-title {
    color: #000;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 5px;
}

.latest-article-title-line {
    width: 100px;
    height: 3px;
    background: #00b3df;
    margin-bottom: 25px;
}

.article-latest-container {
    height: 385px;
    overflow: hidden;
    position: relative;
}

.timeline-item {
    position: relative;
    padding-bottom: 30px;
    display: flex;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 5px;
    bottom: -5px;
    width: 2px;
    background-color: #c4c4c4;
    z-index: 1;
}

.timeline-item:last-child::before {
    display: block;
    background: linear-gradient(to bottom, #c4c4c4 30%, transparent 100%);
}

.timeline-marker {
    width: 15px;
    height: 15px;
    background-color: #a7a7a7;
    border-radius: 50%;
    flex-shrink: 0;
    z-index: 2;
    margin-right: 15px;
    margin-top: 5px;
}

.timeline-content {
    flex-grow: 1;
}

.timeline-content h2 {
    color: #000;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 8px 0;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #8e8e8e;
    font-size: 12px;
    font-weight: 400;
}

.article-meta p {
    margin-right: 5px;
    margin-bottom: 0;
}

.nav-controls {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.nav-btn {
    width: 35px;
    height: 35px;
    background: #eaeaea;
    border: none;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 18px;
}

/* 2. The Moving Track */

.news-track {
    transform: translateY(0);
    will-change: transform;
}

.smooth-transition {
    transition: transform 0.5s ease-out;
}

.banner-slider {
    width: 100%;
    display: block;
}

/* Ensure images cover the area properly */

.banner-slider .new-main-banner {
    width: 100%;
    position: relative;
    /* Needed for the absolute positioned text */
}

/* 1. Make the wrapper the reference point */

.banner-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    /* Keeps buttons inside rounded corners if any */
}

.nav-banner {
    display: flex;
    justify-content: center;
    gap: 85%;
    transform: translateY(-700%);
}

.prev-btn-banner,
.next-btn-banner {
    display: flex;
    width: 40px;
    height: 40px;
    padding: 0 10px;
    justify-content: center;
    align-items: center;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.2);
}

.slick-dots {
    bottom: 5px !important;
}

.slick-dots li.slick-active button:before {
    color: #fff !important;
    opacity: 100;
}

.banner-content2 {
    position: absolute;
    z-index: 2;
    bottom: 30px;
    left: 30px;
}

.banner-content3 {
    position: absolute;
    z-index: 2;
    bottom: 30px;
    left: 30px;
    display: flex;
    align-items: center;
}

.banner-content2 h1 {
    color: #fff;
    font-family: Montserrat;
    font-size: 18px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
}

.banner-content2 p {
    color: #fff;
    font-family: Montserrat;
    font-size: 15px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

.banner-content2-line {
    width: 336px;
    height: 3px;
    background: #00b3df;
    margin-bottom: 10px;
}

.btn-watch-trailer-banner {
    background: transparent;
    border: none;
}

.trailer-info-banner {
    display: flex;
    flex-direction: column;
    margin-top: 10px;
}

.trailer-info-banner h1 {
    color: #fff;
    font-family: Montserrat;
    font-size: 18px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
}

.trailer-info-banner p {
    color: #fff;
    font-family: Montserrat;
    font-size: 15px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

.trailer-info-banner-line {
    width: 134px;
    height: 3px;
    background: #00b3df;
    margin-bottom: 10px;
}

.btn-reels-fyp {
    background: transparent;
    border: none;
    position: absolute;
    right: 15px;
    color: var(--blue-accent, #00b3df);
    text-align: center;
    font-family: Montserrat;
    font-size: 18px;
    font-style: italic;
    font-weight: 500;
    line-height: normal;
}

.views-icon {
    margin-bottom: 3px;
}

/* The Container */

.custom-grid-layout {
    display: grid;
    grid-template-columns: 54% 1fr 20%;
    width: 100%;
    gap: 15px;
    box-sizing: border-box;
    height: 520px;
}

.grid-item-banner img,
.grid-item-reels img {
    width: 100%;
    height: 475px;
    display: block;
    object-fit: contain;
}

.grid-item-reels .reels-home {
    position: relative;
    width: min(100%, 236px);
    aspect-ratio: 240 / 483;
    height: auto;
    margin: 0 auto;
    overflow: hidden;
    margin-top: 8px;
    isolation: isolate;
    --phone-screen-top: 2.9%;
    --phone-screen-side: 4%;
    --phone-screen-bottom: 2.5%;
}

/* 2. The Phone Frame (Overlay) */

.reels-home .phone-frame {
    width: 100%;
    height: 100%;
    z-index: 10;
    object-fit: contain;
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
}

.reels-screen {
    position: absolute;
    top: var(--phone-screen-top);
    right: var(--phone-screen-side);
    bottom: var(--phone-screen-bottom);
    left: var(--phone-screen-side);
    z-index: 1;
    overflow: hidden;
    border-radius: clamp(18px, 10%, 24px);
    background: #000;
}

/* 3. The Scroll Container (Behind the Frame) */

.reels-scroll-container {
    position: absolute;
    inset: 0;
    z-index: 1;
    height: 100%;
    width: 100%;
    border-radius: inherit;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
    cursor: pointer;
    overscroll-behavior-y: contain;
}

/* Hide scrollbar for Chrome/Safari/Opera */

.reels-scroll-container::-webkit-scrollbar {
    display: none;
}

/* 4. The Individual Video Items */

.reel-item {
    width: 100%;
    height: 100%;
    /* Takes full height of the container */
    scroll-snap-align: start;
    /* Forces video to snap to top */
    position: relative;
}

.reel-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Ensures video fills space without stretching */
    display: block;
}

/* Helper class to hide icons */

.d-none {
    display: none;
}

.center-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.4);
    width: clamp(80px, 24%, 80px);
    height: clamp(50px, 24%, 80px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    transition: all 0.2s ease;
}

.center-play-icon svg {
    width: clamp(24px, 12vw, 41px);
    height: auto;
}

/* Position the controls container inside the phone screen */

.reels-controls {
    position: absolute;
    top: clamp(18px, 6%, 26px);
    right: clamp(10px, 8%, 20px);
    z-index: 4;
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 4%, 10px);
    pointer-events: auto;
}

/* Style the buttons */

.control-btn {
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    width: clamp(32px, 18%, 35px);
    height: clamp(32px, 18%, 35px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.control-btn svg {
    width: clamp(16px, 9vw, 20px);
    height: clamp(16px, 9vw, 30px);
}

/* 3. NEW: The Start Overlay */

.reels-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: clamp(18px, 10%, 26px);
    transition:
        opacity 0.4s ease-out,
        visibility 0.4s;
    cursor: pointer;
}

/* When this class is added, the overlay disappears */

.reels-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    /* Passes clicks through to video */
}

/* Overlay Text Styling */

.overlay-title {
    font-size: clamp(16px, 9%, 20px);
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.overlay-text {
    font-size: clamp(12px, 6%, 14px);
    margin-top: 20px;
    max-width: 84%;
    line-height: 1.4;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.overlay-play-btn {
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s;
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
}

.overlay-play-btn:hover {
    transform: scale(1.1);
}

/* Container for UI elements */

.reel-ui {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: clamp(10px, 7%, 20px);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent 30%);
}

/* Bottom Left: Info */

.reel-info {
    color: white;
    width: calc(100% - clamp(52px, 26%, 76px));
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.user-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid white;
}

.username {
    font-weight: 700;
    font-size: 15px;
}

.caption {
    font-size: clamp(11px, 5.5%, 13px);
    margin-bottom: 8px;
    line-height: 1.3;
}

.music-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: 0.9;
}

/* Right Side: Actions */

.reel-actions {
    position: absolute;
    right: clamp(8px, 5%, 15px);
    bottom: clamp(52px, 16%, 70px);
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 5%, 20px);
    align-items: center;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    gap: 4px;
}

.action-btn svg {
    width: clamp(18px, 11%, 24px);
    height: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: transform 0.2s;
}

.action-btn span.count {
    font-size: clamp(10px, 5%, 12px);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Optional: Simple hover effect on buttons */

.reel-actions {
    pointer-events: auto;
    /* Enable clicking buttons */
}

.action-btn:hover svg {
    transform: scale(1.1);
}

/* Progress Bar Container */

.progress-container {
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 3px;
    /* Thickness of the bar */
    background: rgba(255, 255, 255, 0.3);
    /* Faint gray background */
    z-index: 5;
}

.progress-bar {
    width: 0%;
    /* Starts at 0 */
    height: 100%;
    background: #00b3df;
    transition: width 0.1s linear;
}

@media (max-width: 1024px) {
    .grid-item-reels .reels-home {
        width: min(100%, 220px);
    }
}

@media (max-width: 768px) {
    .custom-grid-layout {
        grid-template-columns: 1fr 1fr;
        height: 65em;
        grid-template-areas: "banner banner" "news reels";
    }
    .grid-item-banner {
        grid-area: banner;
    }
    .grid-item-news {
        grid-area: news;
        padding-top: 180px;
    }
    .grid-item-reels {
        grid-area: reels;
        padding-top: 220px;
    }
    .grid-item-news {
        grid-area: news;
        padding-left: 43px;
    }
    .grid-item-banner {
        grid-area: banner;
        height: 288px;
    }
    .grid-item-reels .reels-home {
        width: min(100%, 220px);
    }
}

@media (max-width: 480px) {
    .grid-item-news {
        padding-top: 20px; /* Overrides the 180px */
        padding-left: 15px;
    }

    .grid-item-reels .reels-home {
        width: min(100%, 190px);
    }

    .grid-item-reels {
        padding-top: 20px; /* Overrides the 220px */
    }

    .grid-item-banner {
        height: 480px;
    }

    .reel-ui {
        padding: 10px;
    }
}

@media (max-width: 400px) {
    .grid-item-reels .reels-home {
        width: min(100%, 170px);
    }

    .grid-item-reels {
        padding-top: 20px;
        width: 100%;
    }

    .overlay-title {
        font-size: 16px;
    }

    .overlay-text {
        font-size: 12px;
    }
}
