/* =================================
   MELHORIAS DO CABEÇALHO MOBILE
   ================================= */

/* Configurações para DESKTOP - Ocultar elementos mobile */
@media screen and (min-width: 1025px) {
    .mobile-buttons-row {
        display: none !important;
    }
    
    /* Garantir que os botões desktop estejam visíveis e funcionais */
    .header-buttons {
        display: flex !important;
        gap: 0.5rem !important;
        align-items: center !important;
        position: relative !important;
        z-index: 10 !important;
    }
    
    #profile-btn-desktop,
    #logout-btn-desktop {
        display: flex !important;
        pointer-events: auto !important;
        cursor: pointer !important;
        position: relative !important;
        z-index: 11 !important;
    }
}

/* Aplicar apenas em dispositivos móveis */
@media screen and (max-width: 1024px) {
    /* Reorganizar header para mobile */
    #header {
        flex-direction: column !important;
        align-items: center !important;
        padding: 15px 20px !important;
        gap: 12px !important;
        height: auto !important;
        min-height: auto !important;
    }
    
    /* 1. LOGO NO TOPO - Centralizado e maior */
    .header-top-row {
        width: 100% !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin-bottom: 0 !important;
        position: relative !important;
        padding: 0 10px !important;
    }
    
    #logo-container {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        min-width: auto !important;
        flex-shrink: 0 !important;
        flex: 1 !important;
    }
    
    #logo-container img {
        height: 65px !important; /* Aumentado de 45px para 65px */
        width: auto !important;
    }
    
    /* Ocultar título no mobile - não é necessário */
    #header-title {
        display: none !important;
    }
    
    /* 2. TRÊS BOTÕES DISCRETOS NO CANTO DIREITO */
    .mobile-buttons-row {
        display: flex !important;
        justify-content: flex-end !important;
        align-items: center !important;
        gap: 6px !important;
        position: absolute !important;
        right: 10px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        z-index: 10 !important;
    }
    
    /* Estilo discreto para os três botões */
    #history-toggle-btn-mobile,
    #profile-btn,
    #logout-btn {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        
        /* Tamanho menor e mais discreto */
        width: 36px !important;
        height: 36px !important;
        border-radius: 8px !important;
        
        /* Visual discreto */
        border: none !important;
        background-color: rgba(0, 0, 0, 0.08) !important;
        box-shadow: none !important;
        transition: all 0.2s ease !important;
        
        /* Texto e ícone menores */
        font-size: 14px !important;
        font-weight: 400 !important;
        text-decoration: none !important;
        cursor: pointer !important;
        color: #666 !important;
        
        /* Remover texto, apenas ícones */
        padding: 0 !important;
        min-width: auto !important;
        flex: none !important;
        opacity: 0.7 !important;
    }
    
         /* Ocultar texto dos botões, manter apenas ícones */
     #profile-btn,
     #logout-btn {
         font-size: 0 !important; /* Ocultar texto */
     }
     
     #profile-btn i,
     #logout-btn i,
     #history-toggle-btn-mobile i {
         font-size: 14px !important; /* Tamanho do ícone menor e discreto */
     }
    
    /* Efeitos hover/touch discretos para os botões */
    #history-toggle-btn-mobile:hover,
    #history-toggle-btn-mobile:active,
    #profile-btn:hover,
    #profile-btn:active,
    #logout-btn:hover,
    #logout-btn:active {
        background-color: rgba(0, 0, 0, 0.15) !important;
        opacity: 1 !important;
        transform: scale(1.1) !important;
    }
    
    /* 3. NOME DO USUÁRIO ABAIXO - Discreto */
    #user-info {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        margin-top: 12px !important;
        padding-top: 0 !important;
        border-top: none !important;
        gap: 2px !important;
    }
    
    #user-details-container {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 2px !important;
        width: 100% !important;
        padding: 0 !important;
        height: auto !important;
    }
    
    #username {
        font-size: 13px !important;
        font-weight: 400 !important;
        color: #7f8c8d !important;
        margin: 0 !important;
        text-align: center !important;
        line-height: 1.2 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 90% !important;
        opacity: 0.8 !important;
    }
    
    #user-credits {
        font-size: 10px !important;
        color: #95a5a6 !important;
        margin: 0 !important;
        text-align: center !important;
        line-height: 1.2 !important;
        font-weight: 400 !important;
        opacity: 0.7 !important;
    }
    
         /* Ocultar header-buttons original no mobile */
     .header-buttons {
         display: none !important;
     }
     
     /* Garantir que botões desktop estejam ocultos no mobile */
     #profile-btn-desktop,
     #logout-btn-desktop {
         display: none !important;
     }
    
    /* Reorganizar a estrutura DOM via CSS para mobile */
    #user-info {
        order: 3 !important; /* Nome do usuário por último */
    }
    
    .header-top-row {
        order: 1 !important; /* Logo primeiro */
    }
    
    /* Criar container para os botões modernos */
    #user-info::before {
        content: "" !important;
        order: 2 !important; /* Botões no meio */
        width: 100% !important;
        height: 0 !important;
    }
}

/* Ajustes específicos para telas muito pequenas */
@media screen and (max-width: 480px) {
    #header {
        padding: 12px 15px !important;
        gap: 10px !important;
    }
    
    #logo-container img {
        height: 55px !important; /* Ainda grande, mas um pouco menor */
    }
    
    #history-toggle-btn-mobile,
    #profile-btn,
    #logout-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 12px !important;
        border-radius: 6px !important;
    }
    
    .mobile-buttons-row {
        gap: 4px !important;
        right: 5px !important;
    }
    
    #username {
        font-size: 12px !important;
        max-width: 85% !important;
    }
    
    #user-credits {
        font-size: 9px !important;
    }
}

/* Ajuste do padding do main-container para o novo header mobile */
@media screen and (max-width: 1024px) {
    #main-container {
        padding-top: 120px !important; /* Reduzido para dar mais espaço ao conteúdo */
    }
}

@media screen and (max-width: 768px) {
    #main-container {
        padding-top: 115px !important;
    }
}

@media screen and (max-width: 480px) {
    #main-container {
        padding-top: 110px !important;
    }
} 