/* Menu principal - Design moderno e profissional */
:root {
    /* Cores do menu em modo escuro por padrão */
    --menu-bg: #0F172A;
    --menu-text: rgba(255, 255, 255, 0.95);
    --menu-hover: #38BDF8;
    --menu-active: #0EA5E9;
    --menu-border: rgba(255, 255, 255, 0.1);
    --menu-icon: rgba(255, 255, 255, 0.8);
    --menu-shadow: 0 10px 20px rgba(0, 0, 0, 0.15), 0 6px 6px rgba(0, 0, 0, 0.2);
    --menu-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --menu-width: 280px;
    --menu-collapsed-width: 70px;
    
    /* Novas variáveis para animações avançadas */
    --menu-animation-duration: 0.4s;
    --menu-animation-easing: cubic-bezier(0.25, 0.8, 0.25, 1);
    --menu-entrance-delay: 0.05s;
    --menu-hover-scale: 1.03;
    --menu-active-scale: 1.02;
    --menu-badge-pulse-color: rgba(56, 189, 248, 0.6);
    --menu-item-stagger: 0.05s;
    --menu-submenu-height: 0;
    --menu-submenu-active-height: 500px;
    --menu-header-padding: 1.5rem;
    
    /* Variáveis para cores de badges e status */
    --badge-primary: #38BDF8;
    --badge-success: #10B981;
    --badge-warning: #F59E0B;
    --badge-danger: #EF4444;
    --badge-info: #8B5CF6;
    
    /* Destaques e bordas */
    --menu-item-radius: 8px;
    --menu-glow: 0 0 10px rgba(56, 189, 248, 0.3);
}

/* Reset de estilos para o menu */
.menu-container {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Menu Sidebar */
.sidebar {
    background: var(--menu-bg);
    width: var(--menu-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: var(--menu-transition);
    box-shadow: var(--menu-shadow);
    overflow: hidden;
    /* Adicionar atributos data para uso com AnimeJS */
    data-anime-width: var(--menu-width);
    data-anime-collapsed-width: var(--menu-collapsed-width);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

/* Header do Menu */
.menu-header {
    padding: var(--menu-header-padding);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--menu-border);
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.menu-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--menu-text);
    font-weight: 700;
    font-size: 1.25rem;
}

.menu-logo i {
    font-size: 1.5rem;
    color: var(--menu-hover);
    /* Permitir rotação e transformações */
    transform-origin: center;
    transition: transform var(--menu-animation-duration) var(--menu-animation-easing);
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

/* Menu Principal */
.nav-menu {
    list-style: none;
    padding: 1rem 0;
    margin: 0;
}

.nav-item {
    margin-bottom: 5px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-link:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
}

.nav-link.active {
    background: #3b82f6;
    color: #fff;
}

.nav-link i {
    width: 20px;
    margin-right: 10px;
    font-size: 18px;
}

.nav-link span {
    font-size: 14px;
    font-weight: 500;
}

/* Adicionar novo item no menu */
.nav-item:nth-child(6) .nav-link {
    background: #22c55e;
    color: #fff;
}

.nav-item:nth-child(6) .nav-link:hover {
    background: #16a34a;
}

/* Badge para notificações */
.nav-badge {
    background: var(--badge-primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    margin-left: auto;
    /* Preparar para animação pulsante */
    position: relative;
    z-index: 1;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.nav-badge:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    background: var(--menu-badge-pulse-color);
    z-index: -1;
    opacity: 0;
    transform: scale(1.2);
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.5); opacity: 0; }
    100% { transform: scale(1); opacity: 0; }
}

/* Submenu */
.has-submenu .nav-link:after {
    content: '\f105';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: auto;
    transition: transform var(--menu-animation-duration) var(--menu-animation-easing);
}

.has-submenu.active .nav-link:after {
    transform: rotate(90deg);
}

.submenu {
    list-style: none;
    padding: 0;
    max-height: var(--menu-submenu-height);
    overflow: hidden;
    transition: max-height var(--menu-animation-duration) var(--menu-animation-easing);
    background: rgba(0, 0, 0, 0.3);
    margin: 0 0.5rem;
    border-radius: 0 0 var(--menu-item-radius) var(--menu-item-radius);
}

.has-submenu.active .submenu {
    max-height: var(--menu-submenu-active-height);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.submenu-item {
    margin: 0;
    transform: translateX(-10px);
    opacity: 0;
    transition: all var(--menu-animation-duration) var(--menu-animation-easing);
}

.has-submenu.active .submenu-item {
    transform: translateX(0);
    opacity: 1;
    transition-delay: calc(var(--menu-entrance-delay) * var(--item-index, 0));
}

/* Adicione índices para itens específicos para criar o escalonamento */
.submenu-item:nth-child(1) { --item-index: 1; }
.submenu-item:nth-child(2) { --item-index: 2; }
.submenu-item:nth-child(3) { --item-index: 3; }
.submenu-item:nth-child(4) { --item-index: 4; }
.submenu-item:nth-child(5) { --item-index: 5; }

.submenu-link {
    padding: 0.7rem 1rem 0.7rem 4rem;
    display: block;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--menu-transition);
    transform-origin: left center;
    position: relative;
    border-radius: 4px;
    margin: 0.2rem 0.5rem;
}

.submenu-link:before {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--menu-hover);
    left: 2.5rem;
    top: 50%;
    transform: translateY(-50%) scale(0);
    transition: transform 0.2s ease;
    opacity: 0;
}

.submenu-link:hover:before, 
.submenu-link:focus:before,
.submenu-link.active:before {
    transform: translateY(-50%) scale(1);
    opacity: 1;
}

.submenu-link:hover, .submenu-link:focus,
.submenu-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    transform: scale(var(--menu-hover-scale));
    padding-left: 4.5rem;
}

/* Divisor de seções */
.menu-divider {
    height: 1px;
    background: var(--menu-border);
    margin: 1rem;
    position: relative;
    overflow: hidden;
}

.menu-divider:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 1px;
    width: 100%;
    background: linear-gradient(90deg, transparent, var(--menu-hover), transparent);
    opacity: 0.6;
}

/* Menu Footer */
.menu-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--menu-border);
    margin-top: auto;
    position: absolute;
    bottom: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--menu-text);
    text-decoration: none;
    transition: var(--menu-transition);
}

.user-profile:hover, .user-profile:focus {
    color: #fff;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #fff;
    overflow: hidden;
    border: 2px solid rgba(56, 189, 248, 0.25);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.user-avatar i {
    font-size: 1.2rem;
    color: var(--menu-active);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    overflow: hidden;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    position: relative;
    padding-left: 0.8rem;
}

.user-role:before {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--badge-success);
    border-radius: 50%;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.logout-btn {
    background: rgba(255, 255, 255, 0.07);
    border: none;
    color: var(--menu-icon);
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--menu-transition);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover, .logout-btn:focus {
    color: #fff;
    background: rgba(239, 68, 68, 0.2);
    transform: rotate(15deg);
}

/* Menu Toggle */
.menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1010;
    background: var(--menu-bg);
    color: var(--menu-text);
    border: none;
    padding: 0.7rem;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--menu-transition);
    box-shadow: var(--menu-shadow);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle:hover, .menu-toggle:focus {
    background: var(--menu-hover);
    color: #fff;
    transform: rotate(90deg);
}

.menu-toggle.active {
    left: calc(var(--menu-width) - 3rem);
}

/* Modo Recolhido */
.sidebar.collapsed {
    width: var(--menu-collapsed-width);
}

.sidebar.collapsed .menu-logo span,
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .nav-link:after,
.sidebar.collapsed .user-info,
.sidebar.collapsed .logout-btn {
    display: none;
}

.sidebar.collapsed .nav-link {
    padding: 0.85rem;
    justify-content: center;
}

.sidebar.collapsed .nav-link i {
    margin-right: 0;
    font-size: 1.3rem;
}

.sidebar.collapsed .menu-footer {
    justify-content: center;
}

.sidebar.collapsed + .main-content {
    margin-left: var(--menu-collapsed-width);
}

.sidebar.collapsed .has-submenu.active .submenu {
    display: none;
}

/* Adicionar ícone de collapse/expand */
.collapse-btn {
    position: absolute;
    bottom: 7rem;
    right: -0.7rem;
    background: var(--menu-bg);
    color: var(--menu-text);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid var(--menu-hover);
    font-size: 0.8rem;
    z-index: 1010;
    transition: var(--menu-transition);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.collapse-btn:hover {
    color: #fff;
    background: var(--menu-hover);
    transform: scale(1.1);
}

.sidebar.collapsed .collapse-btn {
    transform: rotate(180deg);
}

/* Efeitos de animação avançados para o menu */
@keyframes menuItemFadeIn {
    from { 
        opacity: 0; 
        transform: translateX(-20px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

.nav-item {
    animation: menuItemFadeIn 0.5s forwards;
    opacity: 0;
    transform: translateX(-20px);
}

.nav-item:nth-child(1) { animation-delay: 0.1s; }
.nav-item:nth-child(2) { animation-delay: 0.15s; }
.nav-item:nth-child(3) { animation-delay: 0.2s; }
.nav-item:nth-child(4) { animation-delay: 0.25s; }
.nav-item:nth-child(5) { animation-delay: 0.3s; }
.nav-item:nth-child(6) { animation-delay: 0.35s; }
.nav-item:nth-child(7) { animation-delay: 0.4s; }
.nav-item:nth-child(8) { animation-delay: 0.45s; }

/* Responsividade */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .menu-toggle {
        display: block;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .menu-toggle.active {
        left: 1rem;
    }
}

/* Ajustes de conteúdo principal */
.main-content {
    margin-left: var(--menu-width);
    transition: var(--menu-transition);
    min-height: 100vh;
    background: #f7fafc;
    position: relative;
}

/* Dark Mode */
.dark-mode {
    --menu-bg: #0F172A;
    --menu-hover: #38BDF8;
    --menu-active: #0EA5E9;
    --badge-primary: #0EA5E9;
    --badge-success: #059669;
    --badge-warning: #D97706;
    --badge-danger: #DC2626;
    --badge-info: #7C3AED;
}

/* Ajustes para scrollbar personalizada */
.ps__rail-y {
    background-color: transparent !important;
    width: 6px !important;
    margin-right: 2px;
}

.ps__thumb-y {
    background-color: rgba(255, 255, 255, 0.3) !important;
    width: 5px !important;
}

/* Adicionar ícone de collapse/expand */
.collapse-btn {
    position: absolute;
    bottom: 7rem;
    right: -1rem;
    background: var(--menu-bg);
    color: var(--menu-text);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid var(--menu-border);
    font-size: 0.8rem;
    z-index: 1010;
    transition: var(--menu-transition);
}

.collapse-btn:hover {
    color: #fff;
    border-color: var(--menu-hover);
}

.sidebar.collapsed .collapse-btn {
    transform: rotate(180deg);
}

/* Modo claro (se necessário) */
.light-mode {
    --menu-bg: #F8FAFC;
    --menu-text: #334155;
    --menu-hover: #38BDF8;
    --menu-active: #0EA5E9;
    --menu-border: rgba(0, 0, 0, 0.1);
    --menu-icon: #64748B;
    --badge-primary: #38BDF8;
    --badge-success: #10B981;
    --badge-warning: #F59E0B;
    --badge-danger: #EF4444;
    --badge-info: #8B5CF6;
}

.light-mode .sidebar {
    border-right: 1px solid rgba(0, 0, 0, 0.08);
}

.light-mode .menu-header,
.light-mode .menu-footer {
    background: rgba(255, 255, 255, 0.7);
}

.light-mode .submenu {
    background: rgba(0, 0, 0, 0.05);
}

.light-mode .nav-link:hover, 
.light-mode .nav-link:focus {
    background: rgba(0, 0, 0, 0.05);
}

.light-mode .nav-link.active {
    background: rgba(56, 189, 248, 0.1);
}

.light-mode .user-role:before {
    background: var(--badge-success);
}

/* Menu Styles */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: #1a1a1a;
    color: #fff;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.menu-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.menu-logo i {
    font-size: 1.5rem;
    color: #2563eb;
}

.nav-menu {
    list-style: none;
    padding: 1rem 0;
    margin: 0;
}

.nav-item {
    margin: 0.25rem 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.2s ease;
    gap: 0.75rem;
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link i {
    width: 1.5rem;
    font-size: 1.1rem;
}

.nav-badge {
    background: #2563eb;
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    margin-left: auto;
}

.menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 1rem 0;
}

.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.2);
    display: none;
}

.has-submenu.active .submenu {
    display: block;
}

.submenu-link {
    display: block;
    padding: 0.5rem 1.5rem 0.5rem 3.75rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.submenu-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.menu-footer {
    margin-top: auto;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #fff;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info {
    line-height: 1.2;
}

.user-name {
    font-weight: 500;
}

.user-role {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

.logout-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

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

.main-content {
    flex: 1;
    padding: 2rem;
    margin-left: 280px;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.875rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 0.5rem;
}

.page-header p {
    color: #6b7280;
    margin: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }
}

/* Scrollbar Styles */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
} 