/* Sidebar V3 - Black & Green Theme with Light/Dark Mode */
/* Theme Variables - Dark Mode (Default) */
:root {
    /* Dark Theme - Black & Green */
    --sidebar-icon-bg: rgba(0, 253, 84, 0.1);
    --sidebar-icon-text: #00FD54;
    --sidebar-bg: #1A1A1A;
    --sidebar-header-bg: #1A1A1A;
    --sidebar-text: #ffffff;
    --sidebar-text-active: #00FD54;
    --sidebar-hover-bg: rgba(0, 253, 84, 0.1);
    --sidebar-hover-text: #00FD54;
    --sidebar-active-bg: rgba(0, 253, 84, 0.15);
    --sidebar-icon-active-bg: #00FD54;
    --sidebar-icon-active-text: #000000;
    --sidebar-scrollbar-thumb: rgba(0, 253, 84, 0.3);
    --sidebar-scrollbar-hover: rgba(0, 253, 84, 0.5);
    --sidebar-submenu-bg: rgba(0, 253, 84, 0.08);
    --sidebar-submenu-hover: rgba(0, 253, 84, 0.12);
    --sidebar-shadow: 2px 0 16px rgba(0, 253, 84, 0.1);
    --sidebar-toggle-hover-bg: rgba(0, 253, 84, 0.1);
    --sidebar-border: rgba(0, 253, 84, 0.2);
    --sidebar-toggle-icon-bg: rgba(0, 253, 84, 0.1);
    --sidebar-toggle-icon-text: #00FD54;
}

/* Light Theme - White with Black & Green accents */
:root.light-theme {
    --sidebar-icon-bg: rgba(0, 0, 0, 0.05);
    --sidebar-icon-text: #4a5568;
    --sidebar-bg: #ffffff;
    --sidebar-header-bg: #ffffff;
    --sidebar-text: #2d3748;
    --sidebar-text-active: #1a202c;
    --sidebar-hover-bg: rgba(0, 0, 0, 0.04);
    --sidebar-hover-text: #1a202c;
    --sidebar-active-bg: rgba(0, 0, 0, 0.08);
    --sidebar-icon-active-bg: #2d3748;
    --sidebar-icon-active-text: #ffffff;
    --sidebar-scrollbar-thumb: rgba(0, 0, 0, 0.2);
    --sidebar-scrollbar-hover: rgba(0, 0, 0, 0.3);
    --sidebar-submenu-bg: rgba(0, 0, 0, 0.03);
    --sidebar-submenu-hover: rgba(0, 0, 0, 0.06);
    --sidebar-shadow: 2px 0 16px rgba(0, 0, 0, 0.08);
    --sidebar-toggle-hover-bg: rgba(0, 0, 0, 0.05);
    --sidebar-border: rgba(0, 0, 0, 0.1);
    --sidebar-toggle-icon-bg: rgba(0, 0, 0, 0.05);
    --sidebar-toggle-icon-text: #4a5568;
}

.sidebar-v3 {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 280px;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, width 0.3s ease;
    z-index: 1000;
    box-shadow: var(--sidebar-shadow);
}

.sidebar-v3.collapsed {
    width: 80px;
}

/* Main content adjustment - only when sidebar-v3 exists */
.sidebar-v3~.main-content {
    margin-left: 280px;
}

.sidebar-v3.collapsed~.main-content {
    margin-left: 80px;
}

/* Header */
.sidebar-v3-header {
    background: var(--sidebar-header-bg);
    height: 4.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-v3-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.sidebar-v3-logo-img {
    height: auto;
    object-fit: contain;
}

.sidebar-v3-logo-full {
    width: 180px;
}

.sidebar-v3-logo-icon {
    width: 50px;
}

/* Logo Theme Switching + Expansão/Colapso */
/* Tema escuro - logo expandida */
.sidebar-v3:not(.collapsed) .logo-dark-theme.sidebar-v3-logo-full {
    display: block;
}

/* Tema claro - logo expandida */
.sidebar-v3:not(.collapsed) .logo-light-theme.sidebar-v3-logo-full {
    display: none;
}

:root.light-theme .sidebar-v3:not(.collapsed) .logo-dark-theme.sidebar-v3-logo-full {
    display: none;
}

:root.light-theme .sidebar-v3:not(.collapsed) .logo-light-theme.sidebar-v3-logo-full {
    display: block;
}

/* Logo colapsada - sempre visível independente do tema */
.sidebar-v3:not(.collapsed) .sidebar-v3-logo-icon {
    display: none;
}

/* Logo colapsada visível quando colapsada */
.sidebar-v3.collapsed .sidebar-v3-logo-full {
    display: none;
}

.sidebar-v3.collapsed .sidebar-v3-logo-icon {
    display: block;
}

/* Navigation */
.sidebar-v3-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 0.75rem;
}

.sidebar-v3-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-v3-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-v3-nav::-webkit-scrollbar-thumb {
    background: var(--sidebar-scrollbar-thumb);
    border-radius: 4px;
}

.sidebar-v3-nav::-webkit-scrollbar-thumb:hover {
    background: var(--sidebar-scrollbar-hover);
}

.sidebar-v3-nav-items {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Navigation Items */
.sidebar-v3-item,
.sidebar-v3-item-expandable {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    color: var(--sidebar-text);
    text-decoration: none;

    position: relative;
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.sidebar-v3.collapsed .sidebar-v3-item,
.sidebar-v3.collapsed .sidebar-v3-item-expandable {
    justify-content: center;
    padding: 0.875rem 0.5rem;
    gap: 0;
}

.sidebar-v3.collapsed .sidebar-v3-item.active,
.sidebar-v3.collapsed .sidebar-v3-item-expandable.active {
    justify-content: center;
    padding: 0.875rem 0.5rem;
}

.sidebar-v3-item:hover,
.sidebar-v3-item-expandable:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-hover-text);
}

.sidebar-v3-item.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-text-active);
    font-weight: 600;
}

.sidebar-v3-item.active .sidebar-v3-icon {
    background: var(--sidebar-icon-active-bg);
    color: var(--sidebar-icon-active-text);
}

/* Icon Wrapper */
.sidebar-v3-icon-wrapper {
    flex-shrink: 0;
}

.sidebar-v3-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sidebar-icon-bg);
    color: var(--sidebar-icon-text);
    font-size: 1.25rem;
}

.sidebar-v3.collapsed .sidebar-v3-icon {
    margin: 0;
}

.sidebar-v3-item:hover .sidebar-v3-icon {
    background: #00FD54;
    color: #000000;
    transform: scale(1.05);
}

/* Label */
.sidebar-v3-label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

}

.sidebar-v3.collapsed .sidebar-v3-label {
    display: none;
}

/* Chevron for expandable items */
.sidebar-v3-chevron {

    font-size: 1rem;
}

.sidebar-v3.collapsed .sidebar-v3-chevron {
    display: none;
}

.sidebar-v3-item-expandable.expanded .sidebar-v3-chevron {
    transform: rotate(180deg);
}

/* Submenu */
.sidebar-v3-submenu {
    max-height: 0;
    overflow: hidden;

    margin-left: 0.5rem;
    padding-left: 0.5rem;
    border-left: 2px solid var(--sidebar-border);
}

.sidebar-v3-submenu.expanded {
    max-height: 500px;
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}

.sidebar-v3.collapsed .sidebar-v3-submenu {
    display: none;
}

.sidebar-v3-submenu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;

    margin-bottom: 0.125rem;
}

.sidebar-v3-submenu-item:hover {
    background: var(--sidebar-submenu-hover);
    color: var(--sidebar-hover-text);
}

.sidebar-v3-submenu-item.active {
    background: var(--sidebar-submenu-bg);
    color: var(--sidebar-text-active);
    font-weight: 500;
}

.sidebar-v3-submenu-item i {
    font-size: 1rem;
}

/* Footer */
.sidebar-v3-footer {
    padding: 1rem;
    border-top: 0.1px solid var(--sidebar-border);
}

.sidebar-v3-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--sidebar-text);
    cursor: pointer;

}

.sidebar-v3.collapsed .sidebar-v3-toggle {
    justify-content: center;
    gap: 0;
}

.sidebar-v3-toggle:hover {
    background: var(--sidebar-toggle-hover-bg);
    color: var(--sidebar-hover-text);
}

.sidebar-v3-toggle-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sidebar-toggle-icon-bg);
    color: var(--sidebar-toggle-icon-text);
    flex-shrink: 0;

}

.sidebar-v3-toggle:hover .sidebar-v3-toggle-icon {
    color: #000000;
}

.sidebar-v3-toggle-icon i {}

.sidebar-v3.collapsed .sidebar-v3-toggle-icon i {
    transform: rotate(180deg);
}

.sidebar-v3-toggle-label {
    font-size: 0.875rem;

}

.sidebar-v3.collapsed .sidebar-v3-toggle-label {
    opacity: 0;
    width: 0;
}

/* Tooltips removed - no labels shown when collapsed */

/* Overlay for mobile */
.sidebar-v3-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
}

.sidebar-v3-overlay.active {
    display: block;
    opacity: 1;
}

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

    .sidebar-v3.mobile-open {
        transform: translateX(0);
    }

    .sidebar-v3.collapsed {
        transform: translateX(-100%);
    }

    /* Fix Layout Margin on Mobile */
    .sidebar-v3 ~ .main-content,
    .sidebar-v3.collapsed ~ .main-content {
        margin-left: 0 !important;
    }
}