/* ===================================
   TABBAR - NAVEGAÇÃO INFERIOR
   =================================== */

/* pixel-perfect ginga.bet.br: barra 60px #00064D, z 9999, sem borda/sombra;
   itens iguais (ícone 24px + texto 12px/400 branco), sem destaque de ativo */
.tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: calc(60px + env(safe-area-inset-bottom));
    background: #00064D;
    border-top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 5px;
    padding: 0 12px env(safe-area-inset-bottom);
    z-index: 9999;
    box-shadow: none;
}

.tabbar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 4px 0;
    color: #FFFFFF;
    text-decoration: none;
    font-size: 12px;
    font-weight: 400;
    font-family: 'Inter', sans-serif;
    transition: none;
    position: relative;
    border: none;
    background: transparent;
    border-radius: 0;
    cursor: pointer;
    min-width: 0;
}

.tabbar-item i {
    font-size: 24px;
    transition: none;
}

.tabbar-item span {
    font-size: 12px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
}

.tabbar-item:hover,
.tabbar-item.active {
    color: #FFFFFF;
}

.tabbar-item:hover i,
.tabbar-item.active i {
    transform: none;
}

/* Badge de notificações */
.chat-badge {
    position: absolute;
    top: 4px;
    right: 8px;
    background: #ff4454;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

/* ===================================
   MODAL CHAT AO VIVO
   =================================== */

.chat-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 33, 46, 0.95);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.chat-modal.active {
    display: flex;
}

.chat-container {
    width: 100%;
    max-width: 500px;
    height: 70vh;
    max-height: 600px;
    background: #1a2c38;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Ajuste mobile para não ser cortado pelo tabbar */
@media (max-width: 768px) {
    .chat-container {
        max-width: 100%;
        height: calc(100vh - 140px);
        max-height: calc(100vh - 140px);
        border-radius: 12px;
        margin-bottom: 80px;
    }
}

/* Header do Chat */
.chat-header {
    background: #213743;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #2f4553;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-info i {
    font-size: 24px;
    color: #00e701;
}

.chat-header-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

.chat-users-count {
    font-size: 12px;
    color: #b1bad3;
}

.chat-close-btn {
    background: transparent;
    border: none;
    color: #b1bad3;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Área de Mensagens */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #0f212e;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #1a2c38;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #2f4553;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #3f5563;
}

/* Mensagem do Sistema */
.chat-system-message {
    background: rgba(0, 231, 1, 0.1);
    border: 1px solid rgba(0, 231, 1, 0.2);
    color: #00e701;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-system-message i {
    font-size: 16px;
}

/* Mensagem de Usuário */
.chat-message {
    background: #1a2c38;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 3px solid #00e701;
}

.chat-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.chat-username {
    font-size: 13px;
    font-weight: 700;
    color: #00e701;
}

.chat-time {
    font-size: 11px;
    color: #b1bad3;
}

.chat-message-text {
    font-size: 14px;
    color: #fff;
    line-height: 1.5;
    word-wrap: break-word;
}

/* Input de Mensagem */
.chat-input-container {
    background: #213743;
    padding: 16px 20px;
    display: flex;
    gap: 12px;
    border-top: 1px solid #2f4553;
}

.chat-input {
    flex: 1;
    background: #0f212e;
    border: 1px solid #2f4553;
    border-radius: 8px;
    padding: 12px 16px;
    color: #fff;
    font-size: 14px;
    transition: all 0.2s;
}

.chat-input:focus {
    outline: none;
    border-color: #00e701;
}

.chat-input::placeholder {
    color: #b1bad3;
}

.chat-send-btn {
    background: #00e701;
    color: #011e28;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send-btn:hover {
    background: #00c201;
    transform: scale(1.05);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

/* ===================================
   RESPONSIVO
   =================================== */

@media (max-width: 767px) {
    .chat-modal {
        padding: 20px;
        align-items: flex-start;
        padding-top: 60px;
    }
    /* spec ginga: ícone 24px + texto 12px também no mobile (sem encolher) */
}

/* Esconder tabbar em desktop — spec ginga: breakpoint 767px (mobile <768) */
@media (min-width: 768px) {
    .tabbar {
        display: none;
    }
}

/* Adicionar padding bottom no body para não cobrir conteúdo */
@media (max-width: 767px) {
    body {
        padding-bottom: calc(70px + env(safe-area-inset-bottom));
    }
}