/* assets/css/menu_hamburger.css */
/* Estilos do Menu Hamburger */

/* Estilos do Menu Hamburger */
.hamburger-menu {
    position: fixed;
    top: 10px;
    left: 15px;
    z-index: 1000;
}

.hamburger-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.hamburger-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.hamburger-icon {
    color: #64748b;
    font-size: 18px;
    transition: transform 0.3s ease;
}

.hamburger-btn.active .hamburger-icon {
    transform: rotate(90deg);
}

.sidebar {
    position: fixed;
    top: 0;
    left: -350px;
    width: 350px;
    height: 100vh;
    background: #fefefe;
    border-right: 1px solid #f1f5f9;
    transition: left 0.3s ease;
    z-index: 999;
    overflow-y: auto;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.08);
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #f1f5f9;
    text-align: center;
    background: #fafbfc;
}

.sidebar-title {
    color: #334155;
    font-size: 1.2rem;
    font-weight: bold;
    margin: 0;
}

.sidebar-subtitle {
    color: #64748b;
    font-size: 0.8rem;
    margin: 5px 0 0 0;
}

.menu-items {
    padding: 20px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 12px 25px;
    color: #475569;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.menu-item:hover {
    background: #f8fafc;
    border-left-color: #64748b;
    color: #334155;
    transform: translateX(5px);
}

.submenu-item {
    display: block;
    padding: 8px 25px 8px 50px;
    color: #64748b;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    position: relative;
    font-size: 0.9rem;
}

.submenu-item:hover {
    background: #f8fafc;
    border-left-color: #94a3b8;
    color: #475569;
}

.menu-item i {
    width: 20px;
    margin-right: 12px;
    text-align: center;
    font-size: 16px;
}

.menu-item-text {
    font-weight: 600;
    font-size: 0.9rem;
}

.submenu-item-text {
    font-weight: 500;
    font-size: 0.8rem;
}

.submenu-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

/* Limite alto o bastante para seções muito longas (ex.: Sistema); sidebar com overflow-y: auto. */
.submenu-container.expanded {
    max-height: 12000px;
}

.menu-item-toggle {
    position: relative;
}

.menu-item-toggle::after {
    content: '\f107';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
    color: #64748b;
}

.menu-item-toggle.expanded::after {
    transform: translateY(-50%) rotate(180deg);
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: #64748b;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.close-btn:hover {
    opacity: 1;
}

/* Busca no menu lateral */
.sidebar-search-wrap {
    margin-top: 16px;
    padding: 0 4px 4px;
    text-align: left;
}

.sidebar-search-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sidebar-search-input-row {
    display: flex;
    align-items: stretch;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sidebar-search-input-row:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.sidebar-search-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 2.5rem;
    min-width: 2.5rem;
    color: #94a3b8;
    font-size: 14px;
    pointer-events: none;
    padding-left: 2px;
}

.sidebar-search-input {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    padding: 10px 12px 10px 4px;
    border: none;
    border-radius: 0;
    font-size: 0.875rem;
    color: #334155;
    background: transparent;
    box-sizing: border-box;
}

.sidebar-search-input::placeholder {
    color: #94a3b8;
}

.sidebar-search-input:focus {
    outline: none;
}

.sidebar-menu-search-hidden {
    display: none !important;
}

.sidebar-menu-search-empty {
    display: none;
    padding: 12px 20px 0;
    text-align: center;
    color: #64748b;
    font-size: 0.85rem;
}

.sidebar-menu-search-empty.is-visible {
    display: block;
}

#sidebar.menu-search-active .submenu-container.expanded {
    max-height: none;
    overflow: visible;
}

/* Durante a busca, esconde favoritos para não empurrar os resultados do menu */
.menu-section.favoritos-section.sidebar-favoritos-hidden-during-search {
    display: none !important;
}

.menu-section {
    margin-bottom: 15px;
}

/* Grupos de submenu - Estilo Dropdown */
.submenu-group {
    margin-bottom: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    padding: 16px 0;
    margin-left: 12px;
    margin-right: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: visible;
}

.submenu-group::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8, #06b6d4);
}

.submenu-group-title {
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.submenu-group-title::before {
    content: '';
    width: 4px;
    height: 16px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.submenu-group-title i {
    color: #3b82f6;
    font-size: 14px;
    margin-right: 8px;
}

.submenu-group .submenu-item {
    margin: 2px 12px;
    border-radius: 8px;
    padding: 10px 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: transparent;
}

.submenu-group .submenu-item:hover {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    transform: translateX(6px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-left: 3px solid #3b82f6;
}

.submenu-group .submenu-item-text {
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    position: relative;
    z-index: 1;
}

.submenu-group .submenu-item:hover .submenu-item-text {
    color: #1e293b;
    font-weight: 600;
}

.submenu-group .submenu-item-text i {
    color: #64748b;
    font-size: 12px;
    transition: color 0.3s ease;
}

.submenu-group .submenu-item:hover .submenu-item-text i {
    color: #3b82f6;
}

/* Animação suave para os grupos */
.submenu-group {
    animation: slideInFromLeft 0.3s ease-out;
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Botões de Favoritar */
.favorito-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 5px;
    font-size: 14px;
    transition: all 0.2s ease;
    opacity: 0;
    z-index: 10;
}

.submenu-item:hover .favorito-btn,
.menu-item:hover .favorito-btn {
    opacity: 1;
}

.favorito-btn:hover {
    color: #fbbf24;
    transform: translateY(-50%) scale(1.2);
}

.favorito-btn.favoritado {
    color: #fbbf24;
    opacity: 1;
}

.favorito-btn.favoritado i {
    font-weight: 900;
}

.favorito-btn-remove {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #fbbf24;
    cursor: pointer;
    padding: 5px;
    font-size: 14px;
    transition: all 0.2s ease;
    opacity: 0.7;
    z-index: 10;
}

.favorito-item:hover .favorito-btn-remove {
    opacity: 1;
}

.favorito-btn-remove:hover {
    color: #f59e0b;
    transform: translateY(-50%) scale(1.2);
}

/* Seção de Favoritos - Mantém padrão normal, apenas destaca com estrela */
.favoritos-section {
    margin-bottom: 15px;
}

/* Garante que os estilos sejam aplicados mesmo quando renderizados dinamicamente */
.favoritos-section .menu-item,
.menu-section.favoritos-section .menu-item {
    display: flex !important;
    align-items: center !important;
    padding: 12px 25px !important;
    color: #475569 !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    border-left: 3px solid transparent !important;
    position: relative !important;
}

.favoritos-section .menu-item:hover,
.menu-section.favoritos-section .menu-item:hover {
    background: #f8fafc !important;
    border-left-color: #64748b !important;
    color: #334155 !important;
    transform: translateX(5px) !important;
}

.favoritos-section .menu-item i.fa-star,
.menu-section.favoritos-section .menu-item i.fa-star,
.favoritos-section .menu-item i[class*="fa-star"],
.menu-section.favoritos-section .menu-item i[class*="fa-star"] {
    color: #fbbf24 !important; /* Estrela dourada para indicar favoritos */
    width: 20px !important;
    margin-right: 12px !important;
    text-align: center !important;
    font-size: 16px !important;
}

.favoritos-section .submenu-item,
.menu-section.favoritos-section .submenu-item {
    display: block !important;
    padding: 8px 25px 8px 50px !important;
    color: #64748b !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    border-left: 3px solid transparent !important;
    position: relative !important;
    font-size: 0.9rem !important;
}

.favoritos-section .submenu-item:hover,
.menu-section.favoritos-section .submenu-item:hover {
    background: #f8fafc !important;
    border-left-color: #94a3b8 !important;
    color: #475569 !important;
}

.favoritos-section .submenu-item i,
.menu-section.favoritos-section .submenu-item i {
    width: 20px !important;
    margin-right: 12px !important;
    text-align: center !important;
    font-size: 14px !important;
    color: #64748b !important;
}

.favoritos-section .submenu-item-text,
.menu-section.favoritos-section .submenu-item-text {
    font-weight: 500 !important;
    font-size: 0.8rem !important;
}

/* Notificações */
.favorito-notificacao {
    position: fixed;
    top: 80px;
    right: 20px;
    background: #1e293b;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    max-width: 300px;
}

.favorito-notificacao.show {
    opacity: 1;
    transform: translateX(0);
}

.favorito-notificacao-success {
    background: #10b981;
}

.favorito-notificacao-error {
    background: #ef4444;
}

.favorito-notificacao-info {
    background: #3b82f6;
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        left: -100%;
    }
    
    .hamburger-menu {
        top: 15px;
        left: 15px;
    }
    
    .favorito-notificacao {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Barra de abas dos headers: sem scrollbar visível; setas .module-nav-arrow */
.module-nav-with-arrows {
    position: relative;
}

.module-nav-scroll {
    overflow-x: auto;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.module-nav-scroll::-webkit-scrollbar {
    display: none;
}

.module-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    color: #64748b;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.module-nav-arrow:hover:not(:disabled):not(.is-disabled) {
    background: #f8fafc;
    color: #334155;
}

.module-nav-arrow--left {
    left: 0;
}

.module-nav-arrow--right {
    right: 0;
}

.module-nav-arrow.is-disabled,
.module-nav-arrow:disabled {
    opacity: 0.2;
    pointer-events: none;
    cursor: default;
}

.module-nav-with-arrows .module-nav-scroll {
    margin-left: 2rem;
    margin-right: 2rem;
}

.module-nav-with-arrows--no-overflow .module-nav-scroll {
    margin-left: 0;
    margin-right: 0;
}

/* FabriNews: barra de abas sobre fundo azul */
.module-nav-with-arrows--on-dark .module-nav-arrow {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.28);
    color: #fff;
    box-shadow: none;
}

.module-nav-with-arrows--on-dark .module-nav-arrow:hover:not(:disabled):not(.is-disabled) {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Reforço: o Tailwind (preflight) carrega antes; garantir posição e empilhamento do painel lateral */
#sidebar.sidebar {
    position: fixed !important;
    box-sizing: border-box;
    z-index: 999 !important;
}
.hamburger-menu {
    position: fixed !important;
    box-sizing: border-box;
    z-index: 1000 !important;
}
