/**
 * Correção Específica para Background Mobile
 * GAMESOFT BR
 * 
 * Este arquivo corrige especificamente o problema das áreas pretas
 * em dispositivos móveis, garantindo que o background ocupe toda a tela.
 */

/* ===== CORREÇÕES GLOBAIS PARA MOBILE ===== */
@media (max-width: 768px) {

    /* Garantir que html e body tenham configuração básica */
    html, body {
        width: 100% !important;
        height: 100% !important;
        min-height: 100vh !important;
        min-height: 100dvh !important; /* Dynamic viewport height para navegadores modernos */
        background-color: var(--bg, #0d0d0f) !important;
        overflow-x: hidden !important;
        position: relative !important;
    }
    
    /* Garantir que o conteúdo após o hero tenha background sólido */
    main {
        background-color: var(--bg, #0d0d0f) !important;
        position: relative !important;
        z-index: 1 !important;
    }

    /* REMOVIDO: Background global que estava se espalhando por todo o site */
    
    /* Corrigir seções hero para mobile */
    .hero, .page-hero {
        min-height: 100vh;
        min-height: 100dvh;
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        background: linear-gradient(135deg, 
            var(--bg, #0d0d0f) 0%, 
            #1a1a2e 50%, 
            var(--bg, #0d0d0f) 100%);
        position: relative;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    /* SVG do hero corrigido */
    #hero-background-svg {
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        object-fit: cover;
        position: absolute;
        top: 0;
        left: 0;
        z-index: -1;
    }

    /* Background responsivo limitado ao hero */
    .press-kit-background {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        z-index: -10 !important;
        background: linear-gradient(135deg,
            var(--bg, #0d0d0f) 0%,
            #1a1a2e 50%,
            var(--bg, #0d0d0f) 100%
        ) !important;
    }

    /* Partículas limitadas ao hero */
    .press-particles {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        z-index: -5 !important;
        opacity: 0.1 !important;
        display: block !important;
    }

    /* Fade-out suave e maior */
    .hero-fade-out,
    .page-hero-fade-out {
        position: absolute !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 120px !important;
        background: linear-gradient(to bottom, 
            transparent 0%, 
            rgba(13, 13, 15, 0.2) 20%,
            rgba(13, 13, 15, 0.5) 50%,
            rgba(13, 13, 15, 0.8) 80%,
            var(--bg, #0d0d0f) 100%) !important;
        z-index: 2 !important;
        pointer-events: none !important;
    }
    
    /* Limitar backgrounds e partículas às seções hero */
    body > .press-kit-background,
    body > .press-particles {
        display: none !important;
    }

    .hero .press-kit-background,
    .hero .press-particles,
    .page-hero .press-kit-background,
    .page-hero .press-particles {
        display: block !important;
    }

    /* Garantir que botões não fiquem sobre o fade */
    .hero .btn,
    .page-hero .btn {
        position: relative !important;
        z-index: 5 !important;
        margin-bottom: 80px !important;
    }

    /* Conteúdo principal com background sólido */
    .container,
    .main-content-wrapper,
    .main-content-area {
        background-color: var(--bg, #0d0d0f) !important;
        background-image: none !important;
        position: relative !important;
        z-index: 10 !important;
        margin-top: 0 !important;
        padding-top: 40px !important;
    }
    
    /* Garantir que não haja espaços em branco */
    * {
        box-sizing: border-box;
    }
    
    /* Correção específica para viewport em dispositivos iOS */
    @supports (-webkit-touch-callout: none) {
        .hero {
            min-height: -webkit-fill-available;
        }

        .page-hero {
            min-height: -webkit-fill-available;
        }

        /* REMOVIDO: press-kit-background e press-particles não precisam mais de height específico
           pois agora são posicionados relativamente à seção hero */
    }
}

/* ===== CORREÇÕES PARA DISPOSITIVOS MUITO PEQUENOS ===== */
@media (max-width: 480px) {
    
    /* Garantir cobertura total em telas muito pequenas */
    .hero,
    .page-hero {
        background: linear-gradient(135deg,
            var(--bg, #0d0d0f) 0%,
            #1a1a2e 50%,
            var(--bg, #0d0d0f) 100%
        ) !important;
    }

    /* press-kit-background já tem seu próprio gradiente definido acima */
    
    /* Reduzir ainda mais a opacidade das partículas */
    .press-particles {
        opacity: 0.1 !important;
    }
}

/* ===== FALLBACK PARA NAVEGADORES ANTIGOS ===== */
@media (max-width: 768px) {
    
    /* Fallback para navegadores que não suportam dvh */
    @supports not (height: 100dvh) {
        .hero {
            min-height: calc(100vh + 60px); /* Adicionar espaço extra para barras do navegador */
        }

        .page-hero {
            min-height: calc(60vh + 60px);
        }

        /* REMOVIDO: press-kit-background e press-particles não precisam mais de height específico
           pois agora são posicionados relativamente à seção hero */
    }
}
