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

.tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a2c38;
    border-top: 1px solid #2f4553;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.tabbar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 12px;
    color: #b1bad3;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s;
    position: relative;
    border: none;
    background: transparent;
    cursor: pointer;
    min-width: 60px;
}

.tabbar-item i {
    font-size: 20px;
    transition: all 0.2s;
}

.tabbar-item span {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.tabbar-item:hover i,
.tabbar-item.active i {
    transform: scale(1.1);
}

.tabbar-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background: #00e701;
    border-radius: 2px 2px 0 0;
}

/* 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: 768px) {
    .chat-modal {
        padding: 20px;
        align-items: flex-start;
        padding-top: 60px;
    }
    
    .tabbar-item span {
        font-size: 9px;
    }
    
    .tabbar-item i {
        font-size: 18px;
    }
}

/* Esconder tabbar em desktop */
@media (min-width: 769px) {
    .tabbar {
        display: none;
    }
}

/* Adicionar padding bottom no body para não cobrir conteúdo */
@media (max-width: 768px) {
    body {
        padding-bottom: 70px;
    }
}