/* Esconde a barra inferior por padrão (telas grandes/desktop) */
.mobile-bottom-nav {
    display: none !important;
}

/* =========================================================
   TODAS AS REGRAS ABAIXO SÓ FUNCIONAM EM TELAS ATÉ 820px
   ========================================================= */
@media (max-width: 820px) {

    /* Exibe a barra inferior no mobile */
    .mobile-bottom-nav {
        display: flex !important;
    }

    /* ===== LAYOUT GLOBAL (Feed/Perfil/Busca) ===== */
    .app-layout {
        display: block !important;
        width: 100% !important;
    }
    .sidebar-left, .sidebar-right, .sidebar-suggestions, .suggestions-sidebar, .right-column, .right-panel {
        display: none !important;
    }
    main, .main-feed, .main-content, .content-area {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    /* ===== MENU MOBILE (BOTTOM BAR) ===== */
    .mobile-bottom-nav {
        position: fixed;
        left: 0; right: 0; bottom: 0;
        height: 66px;
        background: rgba(0,0,0,0.94);
        border-top: 1px solid #222;
        justify-content: space-around;
        align-items: center;
        z-index: 99999;
        padding-bottom: env(safe-area-inset-bottom);
        backdrop-filter: blur(8px);
    }

    .mobile-bottom-nav a {
        flex: 1;
        text-decoration: none;
        color: #bdbdbd;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        font-size: 11px;
        padding: 10px 0;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-bottom-nav i {
        font-size: 20px;
        color: #eaeaea;
    }

    .mobile-bottom-nav a.is-active {
        color: #fff;
    }
    .mobile-bottom-nav a.is-active i {
        color: var(--primary);
        filter: drop-shadow(0 0 10px rgba(211,47,47,0.45));
    }

    /* Botão central de postar (estilo "floating") */
    .mobile-bottom-nav a.nav-post {
        flex: 0.92;
    }
    .mobile-bottom-nav a.nav-post i {
        font-size: 22px;
    }
    .mobile-bottom-nav a.nav-post .nav-post-bubble {
        width: 46px;
        height: 46px;
        border-radius: 50%;
        background: var(--primary);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 10px 22px rgba(0,0,0,0.45);
        border: 1px solid rgba(255,255,255,0.12);
        transform: translateY(-10px);
    }
    .mobile-bottom-nav a.nav-post .nav-post-bubble i {
        color: #fff;
        filter: none;
    }
    .mobile-bottom-nav a.nav-post span {
        margin-top: -6px;
    }

    /* ============================
       CHAT - RESPONSIVO (MOBILE)
       ============================ */
    .chat-active-area {
        height: calc(100vh - 70px) !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    .chat-profile-header {
        padding: 14px 12px !important;
    }

    .chat-profile-header img {
        width: 54px !important;
        height: 54px !important;
        border-width: 2px !important;
        margin-bottom: 8px !important;
    }

    .chat-profile-header h2 {
        font-size: 16px !important;
        margin: 0 !important;
        line-height: 1.2 !important;
    }

    #messages-container {
        flex: 1 !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        padding: 14px 12px !important;
        padding-bottom: 120px !important;
    }

    .message-bubble {
        max-width: 88% !important;
        padding: 12px 14px !important;
        font-size: 14px !important;
        line-height: 1.35 !important;
    }

    .chat-media-img {
        max-width: 78vw !important;
        max-height: 45vh !important;
    }

    .chat-media-video {
        max-width: 78vw !important;
        max-height: 45vh !important;
    }

    .chat-input-container {
        padding: 10px 10px !important;
        position: sticky !important;
        bottom: 0 !important;
        z-index: 20 !important;
        background: #111 !important;
    }

    .input-wrapper {
        padding: 8px 14px !important;
        gap: 10px !important;
        border-radius: 999px !important;
    }

    .input-wrapper input {
        font-size: 14px !important;
        padding: 10px 0 !important;
    }

    .input-tools {
        gap: 14px !important;
        font-size: 20px !important;
    }

    .input-wrapper button i {
        font-size: 22px !important;
    }

    /* Espaço no fim para não ficar atrás do menu */
    body { padding-bottom: 84px; }
}