/* ==========================================================================
   RoPhim Theme - Responsive Breakpoints (matching rophim.gg demo exactly)
   Breakpoints: 1900 → 1599 → 1359 → 1279 → 1120 → 989 → 799 → 640 → 479 → 379
   ========================================================================== */

/* ---------- Extra Large Desktop (max 1900px) ---------- */
@media screen and (max-width: 1900px) {
    .rp-hero__slide {
        height: 760px;
    }
}

/* ---------- Large Desktop (max 1599px) ---------- */
@media screen and (max-width: 1599px) {
    .rp-header__inner {
        padding: 0 20px;
        gap: 1.5rem;
    }

    .rp-container,
    .rp-content-wrap--fullwidth .rp-content {
        padding: 0 20px;
    }

    .rp-header__logo img { height: 40px; }

    .rp-header__nav,
    .rp-header__user { gap: 0.5rem; }

    .rp-header__user .rp-btn--member {
        min-width: 125px;
        padding: 0.5rem 0.8rem;
    }

    .rp-menu-item { padding: 0 0.7rem; font-size: 13px; }
    .rp-header__menu-wrap { gap: 0.6rem; }

    /* Hero */
    .rp-hero__content { padding: 2rem; max-width: 600px; }

    /* Featured card */
    .rp-featured-card .rp-hero__content,
    .rp-featured-card__content { padding: 2rem; max-width: 600px; }

    /* Grid gap */
    .rp-movie-grid { gap: 1rem; }

    /* Section title */
    .rp-section__title { font-size: 1.8em; }

    /* Footer */
    .rp-footer { padding: 2rem; }

    /* Top 10 */
    .rp-top10-item__number { font-size: 8rem; }
    .rp-top10-item__poster-wrap { width: 120px; }
    .rp-top10-item { min-width: 170px; }

    /* Topics grid */
    .rp-topics-grid { grid-template-columns: repeat(4, 1fr); }

    /* Community */
    .rp-irt-table { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Tablet Landscape / Small Desktop (max 1359px) ---------- */
@media screen and (max-width: 1359px) {
    /* Hide inline search - show toggle on mobile */
    .rp-header__search { display: none; }

    .rp-header__inner {
        padding: 0 6px;
        height: 60px;
    }

    .rp-header__logo {
        position: absolute;
        left: 65px;
    }
    .rp-header__logo img { height: 36px; }

    /* Show hamburger */
    .rp-header__hamburger { display: flex; }

    /* Show mobile search icon */
    .rp-header__mobile-search { display: flex; }

    /* Header spacer adjusts */
    .rp-header-spacer { height: 60px; }

    /* Menu wrap becomes mobile dropdown */
    .rp-header__menu-wrap {
        display: none;
        position: absolute;
        z-index: 3;
        top: 100%;
        left: 10px;
        max-width: 360px;
        width: calc(100% - 10px);
        background-color: rgba(59, 73, 135, 0.95) !important;
        padding: 1.5rem;
        border-radius: 0.75rem;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 1rem;
        box-shadow: var(--shadow-large);
    }

    .rp-header__menu-wrap.active {
        display: flex;
    }

    /* Nav becomes grid */
    .rp-header__nav {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        width: 100%;
        padding: 0;
    }

    .rp-menu-item {
        padding: 0.6rem 0;
        line-height: normal;
    }

    .rp-menu-item__link {
        display: block;
        font-weight: 500;
    }

    /* Dropdown in mobile */
    .rp-menu-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: transparent;
        max-height: 200px;
        display: none;
        padding: 0;
    }

    .rp-menu-item--sub.open .rp-menu-dropdown {
        display: block;
    }

    /* User section in mobile */
    .rp-header__user {
        gap: 0.5rem;
        width: 100%;
    }
    .rp-header__user .rp-btn--member {
        flex: 1 1;
        text-align: center;
    }

    /* Mobile search when toggled */
    .rp-header__search.active {
        display: block;
        position: absolute;
        left: 10px;
        right: 50px;
        width: auto;
        max-width: none;
        z-index: 2;
    }

    /* Grid 6 columns */
    .rp-movie-grid {
        grid-template-columns: repeat(6, 1fr) !important;
        gap: 1rem;
    }
    .rp-section-grid .rp-movie-grid {
        grid-template-columns: repeat(6, 1fr) !important;
    }

    /* Top 10 */
    .rp-top10-item__number { font-size: 6rem; margin-right: -20px; }
    .rp-top10-item__poster-wrap { width: 110px; }
    .rp-top10-item { min-width: 150px; }

    /* Featured card */
    .rp-featured-card { min-height: 280px; }
    .rp-featured-card__title { font-size: 1.6em; }
    .rp-featured-card__content { padding: 30px; }

    /* Topics grid 3 cols on tablet */
    .rp-topics-grid { grid-template-columns: repeat(3, 1fr); }

    /* Community stacks */
    .rp-comm-wrap { grid-template-columns: 1fr; }
    .rp-irt-table { grid-template-columns: repeat(3, 1fr); }

    /* Mood cards */
    .rp-mood-card { width: 140px; }

    /* Country carousel */
    .rp-carousel--hoz .swiper-slide { width: 250px; }

    /* Chart carousel */
    .rp-carousel--chart .swiper-slide { width: 240px; }
}

/* ---------- Medium Tablet (max 1279px) ---------- */
@media screen and (max-width: 1279px) {
    /* Hide carousel nav arrows */
    .rp-section-carousel .swiper-button-prev,
    .rp-section-carousel .swiper-button-next { display: none; }

    /* Hero */
    .rp-hero__slide { height: 600px; }
    .rp-hero__content { padding: 0 30px 60px; max-width: 600px; }
    .rp-hero__title { font-size: 2em; }
}

/* ---------- Small Tablet (max 1120px) ---------- */
@media screen and (max-width: 1120px) {
    /* Grid 5 columns */
    .rp-movie-grid {
        grid-template-columns: repeat(5, 1fr) !important;
    }
    .rp-section-grid .rp-movie-grid {
        grid-template-columns: repeat(5, 1fr) !important;
    }

    /* Featured card */
    .rp-featured-card__content { max-width: 500px; }

    /* Footer compact */
    .rp-footer { padding: 3rem 1rem; }

    /* Section carousel */
    .rp-section-carousel .swiper-slide { width: 180px; }

    /* Top 10 */
    .rp-top10-item__number { font-size: 5rem; margin-right: -15px; }
    .rp-top10-item__poster-wrap { width: 100px; }
    .rp-top10-item { min-width: 130px; }
}

/* ---------- Large Mobile / Tablet Portrait (max 989px) ---------- */
@media screen and (max-width: 989px) {
    /* Featured card (big-slide) */
    .rp-featured-card { min-height: 240px; border-radius: 1rem; }
    .rp-featured-card__title { font-size: 1.4em; line-height: 1.4; }
    .rp-featured-card__desc { margin-bottom: 0 !important; }
    .rp-featured-card__content { padding: 1.25rem; max-width: 100%; }

    /* Section title */
    .rp-section__title { font-size: 1.6em; }
    .rp-section__header { margin-bottom: 0.6rem; }

    /* Content gap */
    .rp-content { gap: 40px; }

    /* Sidebar stacks */
    .rp-content-wrap { flex-direction: column; }
    .rp-sidebar { width: 100%; }

    /* Top 10 */
    .rp-top10-item__number { font-size: 4rem; -webkit-text-stroke-width: 2px; margin-right: -12px; }
    .rp-top10-item__poster-wrap { width: 90px; }
    .rp-top10-item { min-width: 115px; }

    /* Carousel slides */
    .rp-section-carousel .swiper-slide { width: 160px; }
}

/* ---------- Mobile Landscape (max 799px) ---------- */
@media screen and (max-width: 799px) {
    /* Header becomes relative on small screens (matching demo) */
    .rp-header {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
    }

    .rp-header-spacer { display: none; }

    .rp-hero { margin-top: 0; }
    .rp-hero__slide { height: 420px; }
    .rp-hero__desc { display: none !important; }

    /* Grid 4 columns */
    .rp-movie-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
    .rp-section-grid .rp-movie-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    /* Content gap */
    .rp-content { gap: 35px; }

    /* Detail page */
    .rp-single-backdrop__content {
        flex-direction: column;
        align-items: flex-start;
        padding: 60px 20px 24px;
    }
    .rp-single-backdrop__poster { width: 140px; }
    .rp-single-backdrop__title { font-size: 24px; }

    /* Filter */
    .rp-filter__tags { max-height: 80px; overflow: hidden; position: relative; }
    .rp-filter__tags.expanded { max-height: none; }

    /* Top 10 */
    .rp-top10-item__number { font-size: 3rem; -webkit-text-stroke-width: 2px; margin-right: -10px; }
    .rp-top10-item__poster-wrap { width: 80px; }
    .rp-top10-item { min-width: 100px; }

    /* Featured card */
    .rp-featured-card { min-height: 200px; }
    .rp-featured-card__title { font-size: 1.2em; }
    .rp-featured-card__sub { display: none; }
    .rp-featured-card__desc { display: none; }
    .rp-featured-card__content { padding: 16px; }

    /* Section carousel */
    .rp-section-carousel .swiper-slide { width: 140px; }

    /* Topics grid 2 cols */
    .rp-topics-grid { grid-template-columns: repeat(2, 1fr); }
    .rp-topic-card { min-height: 90px; }

    /* Community IRT 1 col */
    .rp-irt-table { grid-template-columns: 1fr; }

    /* Tabs nav scroll */
    .rp-tabs-nav { gap: 0; }
    .rp-tabs-nav__btn { font-size: 0.75em; padding: 8px 10px; }

    /* Country carousel */
    .rp-carousel--hoz .swiper-slide { width: 220px; }
    .rp-country-header__title { font-size: 1.2em; }

    /* Chart carousel */
    .rp-carousel--chart .swiper-slide { width: 200px; }
    .rp-chart-card__number { font-size: 1.6em; }

    /* Category pills */
    .rp-category-pills__list { flex-wrap: nowrap; overflow-x: auto; }
    .rp-category-pills__link { padding: 6px 14px; font-size: 12px; }
}

/* ---------- Mobile Portrait (max 640px) ---------- */
@media screen and (max-width: 640px) {
    .rp-container {
        padding: 0 16px;
    }

    /* Content gap matches demo fluid-gap mobile */
    .rp-content { gap: 24px; }

    /* Section header */
    .rp-section__header { min-height: 32px; margin-bottom: 0.75rem; }
    .rp-section__title { font-size: 1.6em; }

    /* Grid 3 columns */
    .rp-movie-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        column-gap: 0.5rem;
        row-gap: 1.5rem;
    }
    .rp-section-grid .rp-movie-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    /* Hero */
    .rp-hero__slide { height: 350px; }
    .rp-hero__title { font-size: 1.6em; margin-bottom: 0.75rem; }
    .rp-hero__content { text-align: center; padding: 0 20px; }
    .rp-hero .swiper-button-prev,
    .rp-hero .swiper-button-next { display: none; }

    /* Card info centered on mobile */
    .rp-movie-card__info { text-align: center; }
    .rp-movie-card__title { font-size: 13px; font-weight: 400; }

    /* Card hover panel disabled on mobile */
    .rp-movie-card__hover-panel { display: none !important; }
    .rp-movie-card:hover .rp-movie-card__info { opacity: 1; }

    /* Card badges on mobile - bottom left stack */
    .rp-movie-card__badges {
        transform: none;
        border-radius: 0;
        left: 5px;
        bottom: 5px;
        gap: 2px;
        flex-direction: column;
        align-items: flex-start;
        overflow: unset;
    }
    .rp-movie-card__badges .rp-badge {
        padding: 0.15rem 0.4rem;
        font-size: 10px;
        border-radius: 1rem;
        box-shadow: 0 0 2px 2px rgba(0,0,0,0.07);
    }

    .rp-movie-card__ep-badge {
        transform: none;
        left: 5px;
        bottom: 5px;
    }
    .rp-movie-card__ep-badge .rp-badge {
        padding: 0.15rem 0.4rem;
        font-size: 10px;
        border-radius: 1rem;
    }

    /* "More" button on mobile */
    .rp-section__more { width: 30px !important; padding: 0; }
    .rp-section__more span { display: none !important; }

    /* Footer */
    .rp-footer { font-size: 12px; padding: 2rem 0; }
    .rp-social-list { gap: 0.5rem; }
    .rp-social-list__link { width: 38px; height: 38px; font-size: 15px; }
    .rp-footer-nav { gap: 6px 16px; }
    .rp-footer__logo-text { font-size: 24px; }

    /* Thumb slider */
    .rp-thumb-swiper .swiper-slide { width: 100px; }

    /* Section carousel */
    .rp-section-carousel .swiper-slide { width: 130px; }

    /* Player */
    .rp-player-actions { padding: 8px 10px; gap: 4px; }
    .rp-player-actions__btn { padding: 4px 8px; font-size: 11px; }
    .rp-player-actions__btn span { display: none; }

    /* Episode grid */
    .rp-episode-list__ep { min-width: 38px; height: 32px; font-size: 11px; }

    /* Pagination */
    .rp-pagination { gap: 3px; margin-top: 24px; }
    .rp-pagination__item { min-width: 32px; height: 32px; padding: 0 8px; font-size: 12px; }

    /* Breadcrumb */
    .rp-breadcrumb { font-size: 12px; }

    /* Sidebar blocks */
    .rp-sidebar-block { padding: 14px; }
    .rp-sidebar-block__title { font-size: 15px; }

    /* Catalog title */
    .rp-catalog__title { font-size: 20px; }

    /* Tabs */
    .rp-tabs__item { padding: 10px 14px; font-size: 13px; }

    /* Detail page */
    .rp-single-backdrop { min-height: auto; }
    .rp-single-backdrop__content {
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 16px 20px;
        min-height: 280px;
    }
    .rp-single-backdrop__poster { width: 120px; }
    .rp-single-backdrop__title { font-size: 20px; }
    .rp-single-backdrop__origin { font-size: 14px; }
    .rp-single-backdrop__actions { flex-wrap: wrap; }

    /* Info table */
    .rp-movie-info__row { flex-direction: column; gap: 2px; }
    .rp-movie-info__label { width: auto; font-size: 12px; }

    /* Episode content stacks */
    .rp-episode-content { flex-direction: column !important; }
    .rp-episode-sidebar { width: 100% !important; }

    /* Worth buttons */
    .rp-worth { flex-direction: column; }
    .rp-worth__btn { justify-content: center; }

    /* Filter */
    .rp-filter { padding: 12px 14px; }
    .rp-filter__tag { padding: 3px 10px; font-size: 11px; }

    /* Report modal */
    .rp-report-modal__content { padding: 18px; margin: 12px; }

    /* Comments */
    .rp-comments__body { padding: 16px; }

    /* Top 10 chart items on mobile */
    .rp-top10-item__info { display: none; }

    /* Mood cards smaller */
    .rp-mood-card { width: 130px; min-height: 80px; padding: 12px; }
    .rp-mood-card__text { font-size: 0.85em; }

    /* Comment cards */
    .rp-comment-swiper .swiper-slide { width: 260px; }

    /* Country carousel */
    .rp-carousel--hoz .swiper-slide { width: 200px; }

    /* Chart carousel */
    .rp-carousel--chart .swiper-slide { width: 160px; }
    .rp-chart-card__number { font-size: 1.4em; }
    .rp-chart-card__alias { display: none; }
}

/* ---------- Small Mobile (max 479px) ---------- */
@media screen and (max-width: 479px) {
    /* Grid 2 columns */
    .rp-movie-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .rp-section-grid .rp-movie-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Hero */
    .rp-hero__slide { height: 300px; }
    .rp-hero__title { font-size: 1.4em; }

    /* Section carousel */
    .rp-section-carousel .swiper-slide { width: 110px; }

    /* Section title */
    .rp-section__title { font-size: 1.4em; }

    /* Topics grid 2 cols small */
    .rp-topics-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .rp-topic-card { min-height: 70px; padding: 10px; }
    .rp-topic-card__name { font-size: 0.9em; }

    /* Mood */
    .rp-mood-card { width: 110px; min-height: 70px; }

    /* Chart & country */
    .rp-carousel--hoz .swiper-slide { width: 180px; }
    .rp-carousel--chart .swiper-slide { width: 140px; }

    /* Featured card */
    .rp-featured-card__title { font-size: 1.1em; }

    /* Top 10 */
    .rp-top10-item__number { font-size: 2.5rem; }
    .rp-top10-item__poster-wrap { width: 70px; }
    .rp-top10-item { min-width: 85px; }

    /* Actors */
    .rp-actor-item { width: 66px; }
    .rp-actor-item__photo { width: 52px; height: 52px; }
    .rp-actors-grid { gap: 12px; }

    /* Header */
    .rp-header__logo-text { font-size: 20px; }
}

/* ---------- Very Small Mobile (max 379px) ---------- */
@media screen and (max-width: 379px) {
    .rp-movie-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.4rem;
    }

    .rp-hero__slide { height: 260px; }
    .rp-hero__title { font-size: 1.2em; }

    .rp-header__logo-text { font-size: 16px; }
    .rp-section-carousel .swiper-slide { width: 100px; }

    .rp-pagination__item { min-width: 32px; font-size: 12px; }
}

/* ---------- Print ---------- */
@media print {
    .rp-header,
    .rp-footer,
    .rp-sidebar,
    .rp-ads-header,
    .rp-ads-catfish,
    .rp-scroll-top,
    .rp-player-area,
    .rp-filter {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }

    .rp-content-wrap {
        display: block;
    }
}
