/* ========================================
   IBO PLAYER PRO THEME
   Folha de estilos para replicar a interface IBO Player
   ======================================== */

/* GLOBAL IBO MODIFIERS */
.theme-layout-ibo,
.theme-layout-ibo body {
    background: radial-gradient(circle at 50% 10%, #201020 0%, #050505 100%) !important;
    background-color: #050505 !important;
    color: #ffffff;
}

/* Ocultar Navegação Netflix no modo IBO */
.theme-layout-ibo .sidebar,
.theme-layout-ibo .navbar,
.theme-layout-ibo .mobile-bottom-nav {
    display: none !important;
}

/* Seção home IBO: sempre sem scroll */
.theme-layout-ibo #section-home {
    height: 100dvh;
    overflow: hidden;
}

/* Retirar os paddings que o Navbar gerava nas outras seções */
.theme-layout-ibo .main-content {
    padding-left: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.theme-layout-ibo #section-live .main-content {
    padding-top: 0 !important;
    padding-left: 0 !important;
}

/* Gerenciamento de Exibição Home */
.theme-layout-ibo .netflix-home-layout {
    display: none !important;
}

.theme-layout-netflix .ibo-home-layout {
    display: none !important;
}

/* Botão Global de Voltar (Sobe nas outras abas) */
.ibo-global-back-btn {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    z-index: 9999;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    backdrop-filter: blur(5px);
    transition: all 0.2s;
}

.ibo-global-back-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.ibo-global-back-btn:hover {
    background: rgba(229, 9, 20, 0.9);
    border-color: #fff;
}

/* Se Home não for ativa, exibir o botão (Exceto no login e player, que têm CSS próprio cobrindo a tela) */
#app-wrapper.theme-layout-ibo:not([data-section="home"]):not([data-section="login"]):not([data-section="player"]) .ibo-global-back-btn {
    display: flex;
}

/* ==================
   HOME IBO LAYOUT
   ================== */
/* ---- Layout Home IBO CENTRALIZADO ---- */
.ibo-home-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100dvh;
    min-height: 100dvh;
    padding: 1.5rem 5%;
    box-sizing: border-box;
    overflow-y: hidden;
    overflow-x: hidden;
}

/* Landscape mobile/tablet: nunca rola — tudo visível na tela */
@media (orientation: landscape) and (max-width: 1400px) and (max-height: 900px) {
    .ibo-home-layout {
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
        justify-content: center;
        align-items: center;
        padding: 10px 3% !important;
        gap: 6px;
        box-sizing: border-box;
    }

    .ibo-header-top {
        font-size: 9px !important;
        margin-bottom: 0 !important;
        flex-shrink: 0;
        text-align: right;
        width: 100%;
    }

    .ibo-logo-container {
        margin-bottom: 0 !important;
        margin-top: 0 !important;
        flex-shrink: 0;
    }

    .ibo-logo-text-ib {
        font-size: 18px !important;
        line-height: 1.1 !important;
    }

    .ibo-logo-sub {
        font-size: 6px !important;
        letter-spacing: 3px !important;
        margin-top: 0 !important;
    }

    .ibo-main-grid {
        gap: 6px !important;
        grid-template-columns: 30% 46% 24% !important;
        grid-template-rows: 1fr !important;
        max-height: calc(100dvh - 130px) !important;
        min-height: 0 !important;
        flex: 1 !important;
        align-items: stretch;
        width: 100%;
    }

    .ibo-tile-large {
        height: 100% !important;
        min-height: 0 !important;
    }

    .ibo-tile-large svg {
        width: 30px !important;
        height: 30px !important;
        margin-bottom: 6px !important;
    }

    .ibo-tile-large span {
        font-size: 0.85rem !important;
    }

    .ibo-tile {
        min-height: 0 !important;
    }

    .ibo-tile svg {
        width: 20px !important;
        height: 20px !important;
        margin-bottom: 4px !important;
    }

    .ibo-tile span {
        font-size: 0.7rem !important;
    }

    .ibo-middle-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: 1fr 1fr !important;
        gap: 6px !important;
        height: 100% !important;
        min-height: 0 !important;
    }

    .ibo-actions-list {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
        gap: 6px !important;
        padding: 0 !important;
        min-height: 0 !important;
    }

    .ibo-action-item {
        flex: 1 !important;
        min-height: 0 !important;
        flex-direction: column !important;
        gap: 4px !important;
        font-size: 0.65rem !important;
        padding: 4px 4px !important;
        background: rgba(255,255,255,0.05);
        border-radius: 6px;
        justify-content: center;
        align-items: center;
        text-align: center;
        display: flex !important;
    }

    .ibo-action-item svg {
        width: 18px !important;
        height: 18px !important;
    }
}

/* Header Info */
.ibo-header-top {
    display: flex;
    justify-content: flex-end;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1rem;
    width: 100%;
    flex-shrink: 0;
}

.ibo-header-top span {
    color: white;
    margin-left: 5px;
    font-weight: 600;
}

/* Logo IBO Pro Clone — Centralizado */
.ibo-logo-container {
    text-align: center;
    margin-bottom: 1rem;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: Arial, sans-serif;
    font-size: 4.5rem;
    font-weight: bold;
    flex-shrink: 0;
}

.ibo-logo-text-ib {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    font-weight: 900;
    font-size: 64px;
    background: linear-gradient(135deg, #ffffff 0%, #a0a0a0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
    color: #fff;
}

.ibo-logo-text-lite {
    font-weight: 200;
    color: #e50914;
    -webkit-text-fill-color: #e50914;
}

.ibo-logo-text-p {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e50914;
    margin: 0 4px;
    position: relative;
    top: -4px;
}

.ibo-logo-text-p svg {
    width: 56px;
    height: 56px;
}

.ibo-logo-text-ro {
    color: #fff;
}

.ibo-logo-sub {
    font-size: 0.85rem;
    color: #666;
    position: relative;
    bottom: auto;
    left: auto;
    letter-spacing: 8px;
    margin-top: -2px;
    text-transform: uppercase;
}

/* Grid Container — centralizado */
.ibo-main-grid {
    display: grid;
    grid-template-columns: 35% 45% 20%;
    gap: 2rem;
    width: 100%;
    max-width: 1400px;
    flex: 0 1 auto;
    max-height: 420px;
    min-height: 280px;
}

/* Base Tile */
.ibo-tile {
    background: linear-gradient(145deg, #8b0015 0%, #4a0007 100%);
    border: 3px solid transparent;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    color: white;
    position: relative;
    overflow: hidden;
}

.ibo-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.1), transparent);
    pointer-events: none;
}

.ibo-tile:hover {
    border-color: #fff;
    transform: scale(1.03);
    box-shadow: 0 0 25px rgba(229, 9, 20, 0.4);
}

.ibo-tile svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1.5rem;
    fill: white;
}

.ibo-tile span {
    font-size: 1.5rem;
    font-weight: 400;
}

/* Giant TV Tile */
.ibo-tile-large {
    height: 100%;
}

.ibo-tile-large svg {
    width: 140px;
    height: 140px;
    margin-bottom: 2rem;
}

.ibo-tile-large span {
    font-size: 2.2rem;
}

/* Middle Center Tiles */
.ibo-middle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 1.5rem;
    height: 100%;
}

/* Right Actions List */
.ibo-actions-list {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3rem;
    padding-left: 2rem;
}

.ibo-action-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    cursor: pointer;
    color: #b3b3b3;
    font-size: 1.4rem;
    font-weight: 300;
    transition: all 0.2s ease;
}

.ibo-action-item svg {
    width: 38px;
    height: 38px;
    fill: #fff;
}

.ibo-action-item:hover {
    color: #fff;
    transform: translateX(10px);
}

/* Mobile Adjustments for IBO */
@media (max-width: 1024px) {
    .ibo-home-layout {
        padding: 1rem 3%;
        gap: 1rem;
    }

    /* Reduzindo o logo para caber melhor no topo do celular horizontal */
    .ibo-logo-container {
        font-size: 3rem;
        margin-bottom: 2rem;
    }

    .ibo-logo-text-ib {
        font-size: 42px;
    }

    .ibo-header-top {
        margin-bottom: 0.5rem;
        font-size: 0.9rem;
    }

    .ibo-main-grid {
        grid-template-columns: 35% 45% 15%;
        gap: 1rem;
        flex: 0 1 auto;
        max-height: min(400px, 60dvh);
        min-height: 0;
    }

    .ibo-tile svg {
        width: 36px;
        height: 36px;
        margin-bottom: 0.5rem;
    }

    .ibo-tile span {
        font-size: 1rem;
        text-align: center;
    }

    .ibo-tile-large svg {
        width: 70px;
        height: 70px;
        margin-bottom: 1rem;
    }

    .ibo-tile-large span {
        font-size: 1.4rem;
    }

    .ibo-middle-grid {
        gap: 1rem;
    }

    /* Ajuste da lista de ações na lateral direita (Settings etc) para caber sem cortar */
    .ibo-actions-list {
        flex-direction: column;
        justify-content: space-around;
        padding-left: 0;
        gap: 1rem;
    }

    .ibo-action-item {
        gap: 0.5rem;
        font-size: 1.1rem;
        flex-direction: column;
        justify-content: center;
        text-align: center;
        background: rgba(255, 255, 255, 0.05);
        padding: 5px;
        border-radius: 8px;
    }

    .ibo-action-item svg {
        width: 24px;
        height: 24px;
    }

    .ibo-action-item span {
        font-size: 0.8rem;
    }
}

/* ---- IBO Portrait Mobile (celular vertical) ---- */
@media (max-width: 767px) and (orientation: portrait) {
    .ibo-home-layout {
        justify-content: center !important;
        padding: 1.2rem 3% !important;
        gap: 0.6rem !important;
        height: 100dvh !important;
        min-height: 0 !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    .ibo-header-top {
        font-size: 0.7rem !important;
        margin-bottom: 0 !important;
        flex-shrink: 0;
    }

    .ibo-logo-container {
        font-size: 2rem !important;
        margin-bottom: 0 !important;
        flex-shrink: 0;
    }

    .ibo-logo-text-ib {
        font-size: 28px !important;
    }

    .ibo-logo-text-p svg {
        width: 28px !important;
        height: 28px !important;
    }

    .ibo-logo-sub {
        font-size: 0.55rem !important;
        letter-spacing: 3px !important;
        margin-top: -1px !important;
    }

    /* Grid com alturas fixas — não cresce para preencher a tela */
    .ibo-main-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: auto auto auto !important;
        max-height: none !important;
        min-height: 0 !important;
        gap: 0.45rem !important;
        width: 100% !important;
        flex: 0 0 auto !important;
        overflow: visible !important;
    }

    /* TV ao Vivo ocupa a linha toda */
    .ibo-tile-large {
        grid-column: 1 / -1 !important;
        height: 90px !important;
        min-height: 0 !important;
        width: 100% !important;
    }

    .ibo-tile-large svg {
        width: 36px !important;
        height: 36px !important;
        margin-bottom: 0.4rem !important;
    }

    .ibo-tile-large span {
        font-size: 1rem !important;
    }

    /* Tiles do meio: 2 colunas com altura fixa */
    .ibo-middle-grid {
        grid-column: 1 / -1 !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: 100px 100px !important;
        gap: 0.45rem !important;
        height: auto !important;
        min-height: 0 !important;
    }

    .ibo-tile {
        height: 100px !important;
        min-height: 0 !important;
    }

    /* Ações: linha horizontal abaixo */
    .ibo-actions-list {
        grid-column: 1 / -1 !important;
        flex-direction: row !important;
        justify-content: center !important;
        gap: 0.5rem !important;
        padding: 0 !important;
        flex-shrink: 0 !important;
        width: 100% !important;
    }

    .ibo-action-item {
        flex: unset !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.3rem !important;
        font-size: 0.8rem !important;
        padding: 8px 10px !important;
        background: rgba(255, 255, 255, 0.06) !important;
        border-radius: 8px !important;
        min-width: 65px !important;
        transform: none !important;
    }

    .ibo-action-item svg {
        width: 22px !important;
        height: 22px !important;
    }

    .ibo-action-item span {
        font-size: 0.75rem !important;
    }

    .ibo-tile svg {
        width: 30px !important;
        height: 30px !important;
        margin-bottom: 0.3rem !important;
    }

    .ibo-tile span {
        font-size: 1rem !important;
    }
}

/* Quando for celular muito estreito, forçar um layout de grid menor ainda, se necessário */
@media (max-width: 767px) and (orientation: landscape) {
    .ibo-home-layout {
        padding: 0.5rem 3%;
        justify-content: center;
        align-items: center;
        gap: 0.4rem;
    }

    .ibo-logo-container {
        font-size: 2rem;
        margin-bottom: 0.3rem;
        flex-shrink: 0;
    }

    .ibo-logo-text-ib {
        font-size: 28px;
    }

    .ibo-logo-sub {
        font-size: 0.5rem !important;
        letter-spacing: 3px !important;
    }

    .ibo-main-grid {
        grid-template-columns: 30% 44% 22% !important;
        gap: 0.4rem !important;
        width: 100% !important;
        max-height: calc(100dvh - 110px) !important;
        flex: 0 1 auto !important;
        align-items: stretch;
    }

    .ibo-tile-large svg {
        width: 34px !important;
        height: 34px !important;
        margin-bottom: 0.25rem !important;
    }

    .ibo-tile-large span {
        font-size: 1rem !important;
    }

    .ibo-tile svg {
        width: 28px !important;
        height: 28px !important;
        margin-bottom: 0.25rem !important;
    }

    .ibo-tile span {
        font-size: 0.9rem !important;
    }

    .ibo-action-item {
        gap: 0.2rem !important;
        padding: 6px 5px !important;
    }

    .ibo-action-item svg {
        width: 22px !important;
        height: 22px !important;
    }

    .ibo-action-item span {
        font-size: 0.75rem !important;
    }
}

/* ==================
   VOD IBO LAYOUT (Filmes / Séries)
   ================== */
.theme-layout-ibo #section-movies .container:first-child,
.theme-layout-ibo #section-series .container:first-child {
    display: none;
}

.theme-layout-ibo #section-movies .main-content,
.theme-layout-ibo #section-series .main-content {
    height: 100vh;
    overflow: hidden;
    padding: 0 !important;
}

.theme-layout-ibo .content-section {
    height: 100%;
}

/* Container principal 2 colunas */
.ibo-vod-container {
    display: flex;
    height: 100%;
    width: 100%;
    background: #0a0a0a;
}

/* Modo tela cheia (desktop): removida a ocultação da sidebar para manter a lista de categorias sempre visível */

/* Botão voltar para categorias */
.ibo-vod-back-cats {
    display: none !important; /* Escondido por padrão no Desktop, pois a sidebar fica visível */
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-right: 14px;
    transition: background 0.2s;
    flex-shrink: 0;
    align-items: center;
}
.ibo-vod-back-cats:hover {
    background: rgba(229,9,20,0.25);
    border-color: #e50914;
}

/* Sidebar Categorias */
.ibo-vod-sidebar {
    width: 280px;
    min-width: 240px;
    background: #0d0d0d;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding-top: 85px;
}

.ibo-vod-sidebar::-webkit-scrollbar {
    width: 5px;
}

.ibo-vod-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}

.ibo-vod-sidebar-title {
    padding: 0 20px 15px;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: #e50914;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 8px;
}

.ibo-vod-cat {
    padding: 14px 22px;
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ibo-vod-cat:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    padding-left: 24px;
}

.ibo-vod-cat.active {
    background: rgba(229, 9, 20, 0.12);
    color: #fff;
    border-left-color: #e50914;
    font-weight: 600;
}

/* Área principal (direita) */
.ibo-vod-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #0a0a0a;
}

.ibo-vod-grid-header {
    padding: 14px 24px;
    background: rgba(0, 0, 0, 0.4);
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
}

/* Grade de cards */
.ibo-vod-grid {
    flex: 1;
    overflow-y: auto;
    padding: 25px 30px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 22px;
    align-content: start;
}

.ibo-vod-grid::-webkit-scrollbar {
    width: 6px;
}

.ibo-vod-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}

/* Card individual */
.ibo-vod-card {
    cursor: pointer;
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
}

.ibo-vod-card:hover {
    transform: translateY(-6px);
}

/* Poster */
.ibo-card-poster {
    position: relative;
    aspect-ratio: 2/3;
    border-radius: 8px;
    overflow: hidden;
    background: #1a1a1a;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: box-shadow 0.2s;
}

.ibo-vod-card:hover .ibo-card-poster {
    box-shadow: 0 8px 25px rgba(229, 9, 20, 0.35);
}

.ibo-card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 1;
}

.ibo-card-letter {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.15);
    z-index: 0;
}

.ibo-card-fav-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    font-size: 16px;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6));
}

/* Botão Favorito clicável */
.ibo-card-fav-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
    opacity: 0;
    color: rgba(255, 255, 255, 0.7);
}

.ibo-vod-card:hover .ibo-card-fav-btn {
    opacity: 1;
}

.ibo-card-fav-btn.active {
    opacity: 1;
    color: #e50914;
    background: rgba(229, 9, 20, 0.2);
}

/* Info embaixo do poster */
.ibo-card-info {
    padding: 10px 4px 6px;
}

.ibo-card-title {
    font-size: 13px;
    font-weight: 600;
    color: #e0e0e0;
    line-height: 1.3;
    max-height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ibo-card-meta {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
}

/* Seções especiais (Continuar / Favoritos) */
.ibo-vod-special-rows {
    flex-shrink: 0;
}

.ibo-special-section {
    padding: 15px 30px 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ibo-special-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
}

.ibo-special-row {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 15px;
}

.ibo-special-row::-webkit-scrollbar {
    height: 4px;
}

.ibo-special-row::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.ibo-special-row .ibo-vod-card {
    min-width: 140px;
    max-width: 160px;
    flex-shrink: 0;
}

/* Estado vazio */
.ibo-vod-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 15px;
}

/* Loading */
.ibo-vod-loading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}

.ibo-vod-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #e50914;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ============================================
   AJUSTES DE SOBREPOSIÇÃO (BACK BUTTON)
   ============================================ */
/* Corrige a sobreposição do botão voltar na aba de Canais (Live TV) no layout IBO */
.theme-layout-ibo #section-live .live-categories-panel {
    padding-top: 85px;
}

/* Corrige a sobreposição do botão voltar no painel principal de VOD (Filmes/Séries) */
.theme-layout-ibo .ibo-vod-grid-header {
    padding-left: 75px; 
}

/* ============================================
   TABLET IBO VOD (900px)
   ============================================ */
/* ============================================
   TABLET VOD (≤900px) — portrait only
   ============================================ */
@media (max-width: 900px) and (orientation: portrait) {
    .ibo-vod-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .ibo-vod-sidebar {
        width: 100%;
        min-width: 100%;
        max-height: 45vh;
        padding-top: 8px;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .ibo-vod-sidebar-title {
        text-align: center;
        padding: 0 16px 12px;
    }

    .ibo-vod-cat {
        padding: 14px 20px;
        text-align: center;
        border-left: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04);
        font-size: 13px;
    }

    .ibo-vod-cat:hover { padding-left: 20px; }

    .ibo-vod-cat.active {
        border-left-color: transparent;
        background: rgba(229, 9, 20, 0.18);
    }

    .ibo-vod-main { flex: 1; min-height: 50vh; }

    .ibo-vod-grid-header {
        padding: 12px 16px !important;
        padding-left: 16px !important;
        font-size: 15px;
    }

    .ibo-vod-grid {
        padding: 16px 12px;
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 14px;
    }

    .ibo-vod-container.ibo-fullscreen .ibo-vod-sidebar { display: none; }
    .ibo-vod-container.ibo-fullscreen .ibo-vod-main { width: 100%; }
    .ibo-vod-container.ibo-fullscreen .ibo-vod-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }

    .ibo-vod-back-cats {
        display: inline-flex !important;
        font-size: 13px;
        padding: 8px 14px;
    }
}

/* ============================================================
   VOD LANDSCAPE — TODOS os celulares/tablets em modo paisagem
   max-width: 1200px e max-height: 650px cobre TODOS os phones
   ============================================================ */
@media screen and (max-width: 1200px) and (max-height: 650px) and (orientation: landscape) {
    /* VOD container: 2 colunas lado a lado, tela cheia */
    .ibo-vod-container {
        position: fixed !important;
        top: 0; left: 0; right: 0; bottom: 0;
        flex-direction: row !important;
        overflow: hidden !important;
        z-index: 500;
        background: #050505;
    }
    
    /* Netflix: offset navbar e bottom nav */
    .theme-layout-netflix .ibo-vod-container {
        top: 44px !important;
        bottom: 50px !important;
    }
    
    /* IBO: tela cheia */
    .theme-layout-ibo .ibo-vod-container {
        top: 0 !important;
        bottom: 0 !important;
    }
    
    /* Sidebar: 25% da tela — espaço suficiente para nomes das categorias */
    .ibo-vod-sidebar {
        flex: 0 0 25% !important;
        width: 25% !important;
        min-width: 160px !important;
        max-width: 220px !important;
        max-height: none !important;
        height: 100% !important;
        padding-top: 0 !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        border-right: 1px solid rgba(255,255,255,0.08) !important;
        border-bottom: none !important;
    }

    .ibo-vod-sidebar-title { font-size: 13px; padding: 10px 10px 6px; text-align: left; font-weight: bold; color: #aaa; }

    /* Categoria: min-height 44px (toque confortável), nome quebra em 2 linhas */
    .ibo-vod-cat {
        font-size: 13px !important;
        font-weight: 500 !important;
        padding: 0 10px !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        text-align: left !important;
        line-height: 1.3 !important;
        white-space: normal !important;
        word-break: break-word !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
    }

    /* Grid: auto-fill responsivo — se adapta à largura disponível */
    .ibo-vod-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
        gap: 8px !important;
        padding: 10px !important;
    }

    /* Fullscreen: manter sidebar visível no landscape */
    .ibo-vod-container.ibo-fullscreen .ibo-vod-sidebar { display: flex !important; }
    .ibo-vod-container.ibo-fullscreen .ibo-vod-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
        gap: 8px !important;
        padding: 10px !important;
    }
    
    .ibo-vod-back-cats { display: none !important; }
    .ibo-vod-grid-header { padding: 10px 14px !important; font-size: 14px; }

    /* Força os cards a se espremerem no grid de 5-6 colunas */
    .ibo-vod-card {
        min-width: 0 !important;
        width: 100% !important;
    }

    .ibo-card-info { padding: 6px 4px 6px; }
    .ibo-card-title { font-size: 11px; -webkit-line-clamp: 2; line-clamp: 2; font-weight: 500; }
    .ibo-card-meta { display: flex !important; font-size: 9px; margin-top: 3px; }
    .ibo-card-poster { border-radius: 6px; aspect-ratio: 2/3 !important; }
    .ibo-card-fav-btn { width: 22px; height: 22px; font-size: 11px; opacity: 1 !important; }
}

/* ============================================================
   MOBILE PORTRAIT — Correções específicas para celular vertical
   ============================================================ */
@media (max-width: 768px) {

    /* ---- VOD (Filmes/Séries) mobile portrait ---- */

    /* Altura correta: descontar bottom nav */
    .theme-layout-ibo #section-movies .main-content,
    .theme-layout-ibo #section-series .main-content {
        height: calc(100dvh - var(--bottom-nav-height, 60px)) !important;
        max-height: calc(100dvh - var(--bottom-nav-height, 60px)) !important;
    }

    /* Container: preenche o espaço disponível */
    .theme-layout-ibo #section-movies .ibo-vod-container,
    .theme-layout-ibo #section-series .ibo-vod-container {
        height: 100% !important;
        min-height: 0 !important;
    }

    /* Main (grid): ocupa o espaço restante e rola internamente */
    .ibo-vod-main {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    .ibo-vod-grid {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Categorias de filmes/séries: igual canal — 13px, weight 500 */
    .ibo-vod-cat {
        font-size: 13px !important;
        font-weight: 500 !important;
    }
    .ibo-vod-sidebar-title {
        font-size: 13px !important;
    }

    /* Esconder botão global ← em filmes/séries — ibo-vod-back-cats já serve */
    #app-wrapper.theme-layout-ibo[data-section="movies"] .ibo-global-back-btn,
    #app-wrapper.theme-layout-ibo[data-section="series"] .ibo-global-back-btn {
        display: none !important;
    }

    /* ---- 1. IBO Home: tela cheia fixa, SEM scroll (igual a smart TV) ---- */
    .ibo-home-layout {
        height: 100dvh;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 8px 4%;
        padding-bottom: max(8px, env(safe-area-inset-bottom, 8px));
        gap: 8px;
        box-sizing: border-box;
    }

    .ibo-header-top {
        font-size: 11px;
        justify-content: center;
        margin-bottom: 0;
        width: 100%;
    }

    .ibo-logo-container {
        font-size: 2rem !important;
        margin-bottom: 8px !important;
        margin-top: 0 !important;
    }

    /* Grid de tiles: TV em cima, 2x2 embaixo, actions em linha */
    .ibo-main-grid {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
        max-height: none;
        min-height: 0;
        flex: 0 0 auto;
    }

    .ibo-tile-large {
        height: 90px;
        width: 100%;
    }

    .ibo-tile-large svg {
        width: 36px;
        height: 36px;
        margin-bottom: 6px;
    }

    .ibo-tile-large span {
        font-size: 1rem;
    }

    .ibo-middle-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 85px 85px;
        gap: 10px;
        height: auto;
    }

    .ibo-tile {
        height: 85px;
        min-height: 0;
    }

    .ibo-tile svg {
        width: 26px;
        height: 26px;
        margin-bottom: 5px;
    }

    .ibo-tile span {
        font-size: 1rem;
    }

    .ibo-actions-list {
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        padding-left: 0;
        gap: 8px;
        width: 100%;
    }

    .ibo-action-item {
        flex: 1;
        flex-direction: column;
        gap: 4px;
        font-size: 0.8rem;
        padding: 8px 4px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 8px;
        justify-content: center;
        text-align: center;
        transform: none !important;
    }

    .ibo-action-item svg {
        width: 20px;
        height: 20px;
    }
}

/* ============================================================
   MOBILE LANDSCAPE — Home IBO centralizada e sem scroll
   Aplica a TODOS os celulares em modo paisagem (≤900px)
   Vem depois do bloco 768px para ter prioridade sobre ele
   ============================================================ */
@media (max-width: 900px) and (orientation: landscape) {

    /* Seção home: altura fixa, sem scroll */
    .theme-layout-ibo #section-home {
        height: 100dvh !important;
        overflow: hidden !important;
    }

    /* Home: ocupa tela cheia, flex-column, SEM scroll */
    .ibo-home-layout {
        height: 100dvh !important;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 2px 2% 2px !important;
        gap: 4px;
        box-sizing: border-box;
    }

    /* Expiry: compacto no topo */
    .ibo-header-top {
        font-size: 9px !important;
        margin-bottom: 0 !important;
        width: 100%;
        text-align: center;
        flex-shrink: 0;
    }

    /* Logo: menor e sem margens extras */
    .ibo-logo-container {
        margin-bottom: 0 !important;
        margin-top: 0 !important;
        flex-shrink: 0;
    }
    .ibo-logo-text-ib {
        font-size: 18px !important;
        -webkit-text-fill-color: transparent !important;
        line-height: 1.1 !important;
    }
    .ibo-logo-sub {
        font-size: 7px !important;
        letter-spacing: 3px !important;
        margin-top: 0 !important;
    }

    /* Grid principal: 3 colunas lado a lado, expande para preencher espaço disponível */
    .ibo-main-grid {
        display: grid !important;
        grid-template-columns: 30% 46% 24% !important;
        grid-template-rows: 1fr !important;
        gap: 5px !important;
        width: 100%;
        flex: 1 !important;
        min-height: 0;
        max-height: none !important;
        align-items: stretch;
    }

    /* TV ao Vivo: ocupa altura do grid */
    .ibo-tile-large {
        height: 100% !important;
        min-height: 70px;
        width: 100%;
    }
    .ibo-tile-large svg {
        width: 28px !important;
        height: 28px !important;
        margin-bottom: 4px !important;
    }
    .ibo-tile-large span { font-size: 0.8rem !important; }

    /* Middle grid: 2x2, altura total da célula */
    .ibo-middle-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: 1fr 1fr !important;
        gap: 5px !important;
        height: 100% !important;
    }

    /* Tiles normais */
    .ibo-tile {
        min-height: 50px !important;
        height: auto;
    }
    .ibo-tile svg {
        width: 18px !important;
        height: 18px !important;
        margin-bottom: 3px !important;
    }
    .ibo-tile span { font-size: 0.65rem !important; }

    /* Actions: coluna vertical à direita */
    .ibo-actions-list {
        display: flex !important;
        flex-direction: column !important;
        justify-content: stretch !important;
        height: 100% !important;
        gap: 5px !important;
        padding: 0 !important;
        width: 100%;
    }
    .ibo-action-item {
        flex: 1 !important;
        flex-direction: column !important;
        gap: 2px !important;
        font-size: 0.58rem !important;
        padding: 3px 2px !important;
        background: rgba(255,255,255,0.05);
        border-radius: 6px;
        justify-content: center;
        align-items: center;
        text-align: center;
        display: flex !important;
        min-height: 0 !important;
    }
    .ibo-action-item svg {
        width: 14px !important;
        height: 14px !important;
    }

    /* Categorias de filmes/séries: igual canal — 13px, weight 500 */
    .ibo-vod-cat {
        font-size: 13px !important;
        font-weight: 500 !important;
    }
    .ibo-vod-sidebar-title {
        font-size: 13px !important;
    }
}

/* ============================================================
   SETTINGS MOBILE (IBO layout) — padding correto para botão voltar
   ============================================================ */
.theme-layout-ibo #section-settings .main-content {
    padding-top: 65px !important;
    overflow-y: auto;
    box-sizing: border-box;
}

/* Em landscape: settings usa layout fixo — padding-top 0 (o espaço do botão ← está no settings-container) */
@media (max-width: 1200px) and (orientation: landscape) {
    .theme-layout-ibo #section-settings {
        height: 100dvh;
        overflow: hidden;
    }
    .theme-layout-ibo #section-settings .main-content {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        height: 100dvh !important;
        overflow: hidden !important;
    }
}

@media (max-width: 900px) {
    .theme-layout-ibo #section-settings .main-content {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    .theme-layout-ibo .settings-container {
        padding: 0.5rem 0;
    }
    .theme-layout-ibo .settings-title {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }
}

/* ============================================================
   NETFLIX LAYOUT LANDSCAPE — Filmes e Séries com coluna de categorias
   Corrige o ibo-vod-container para não usar position:fixed no Netflix
   ============================================================ */
@media screen and (max-width: 1200px) and (max-height: 650px) and (orientation: landscape) {

    /* Seções filmes/séries: estrutura flex para preencher o viewport */
    .theme-layout-netflix #section-movies .main-content,
    .theme-layout-netflix #section-series .main-content {
        height: 100dvh !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        padding-bottom: 0 !important;
    }

    /* Ocultar o título da seção (as categorias IBO já servem de cabeçalho) */
    .theme-layout-netflix #section-movies .container,
    .theme-layout-netflix #section-series .container {
        display: none !important;
    }

    /* Área de conteúdo: preenche o espaço restante abaixo do navbar */
    .theme-layout-netflix #section-movies .content-section,
    .theme-layout-netflix #section-series .content-section {
        flex: 1 !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: 0 !important;
    }

    /* IBO container: posicionamento relativo (não fixed) no layout Netflix
       Isso evita que o container fique invisível por conflito de z-index */
    .theme-layout-netflix .ibo-vod-container {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        height: 100% !important;
        z-index: auto !important;
    }
}