/* ============================================
   SIDEBAR STYLES - EdoisFilms System
   ============================================ */

/* Sidebar Container */
.sidebar-modern {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    background-color: #ffffff;
    border-right: 1px solid #e5e7eb;
    color: #374151;
    transition: all 0.3s;
    z-index: 50;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar-modern.w-64 {
    width: 16rem;
}

.sidebar-modern.w-20 {
    width: 5rem;
}

/* Sidebar collapsed - center logo */
.sidebar-modern.w-20 .sidebar-header {
    justify-content: center;
}

/* Logo completa (sidebar aberta) */
.logo-full {
    height: 2.8rem;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

/* Logo ícone (sidebar colapsada) */
.logo-icon {
    height: 2.5rem;
    width: 2.5rem;
    object-fit: contain;
}

/* Sidebar collapsed - hide text, show only icons */
.sidebar-modern.w-20 .sidebar-item span,
.sidebar-modern.w-20 .submenu-item span {
    display: none;
}

.sidebar-modern.w-20 .dropdown-arrow {
    display: none;
}

/* Tooltip/Dropdown when collapsed */
.sidebar-modern.w-20 .sidebar-item {
    position: relative;
    justify-content: center;
    padding: 0.75rem;
}

.sidebar-modern.w-20 .submenu-container {
    display: none !important;
}

.sidebar-modern.w-20 .menu-section {
    position: relative;
}

/* Hover tooltip for collapsed sidebar - APENAS para itens SEM submenu */
.sidebar-modern.w-20 a.sidebar-item:hover::after {
    content: attr(data-tooltip);
    position: fixed;
    left: 5.5rem;
    transform: translateY(-50%);
    padding: 0.5rem 1rem;
    background-color: #1f2937;
    color: #ffffff;
    border-radius: 0.375rem;
    white-space: nowrap;
    font-size: 0.875rem;
    z-index: 9999;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    pointer-events: none;
}

/* NÃO mostrar tooltip para botões com submenu */
.sidebar-modern.w-20 button.sidebar-item:hover::after {
    display: none;
}

/* Dropdown menu ao hover (collapsed) */
.sidebar-modern.w-20 .hover-menu {
    display: none;
    position: fixed;
    left: 5.5rem;
    margin-left: 0;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    min-width: 14rem;
    padding: 0.5rem;
    z-index: 9999;
}

/* Hover menu quando sidebar expandida - esconder */
.sidebar-modern.w-64 .hover-menu {
    display: none !important;
}

.hover-menu {
    display: none;
}

.hover-menu .submenu-item {
    margin-left: 0;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    border-radius: 0.375rem;
    text-decoration: none;
    color: #374151;
    transition: all 0.15s ease;
}

.hover-menu .submenu-item:hover {
    background-color: #f3f4f6;
}

.hover-menu .submenu-item span {
    display: inline !important;
    margin-left: 0.75rem;
    font-size: 0.875rem;
    text-transform: uppercase;
}

.hover-menu .submenu-item svg {
    width: 1.125rem;
    height: 1.125rem;
    color: #6b7280;
}

/* Header / Logo Area */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.sidebar-logo-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.sidebar-header img {
    height: 2.8rem;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

/* Collapse/Expand Buttons */
.collapse-btn,
.expand-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0.25rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #6b7280;
    transition: all 0.2s ease;
    border-radius: 0.375rem;
}

.collapse-btn:hover,
.expand-btn:hover {
    color: #374151;
    background-color: #f3f4f6;
}

.collapse-btn svg,
.expand-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

.sidebar-logo-placeholder {
    width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(to bottom right, #a855f7, #6366f1);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.sidebar-logo-placeholder svg {
    width: 1.5rem;
    height: 1.5rem;
    color: #ffffff;
}

/* Navigation Menu */
.sidebar-nav {
    padding: 0.75rem;
    overflow-y: auto;
}

/* Menu Items */
.sidebar-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    transition: all 0.15s;
    cursor: pointer;
    font-size: 0.9rem;
    background: transparent;
    border: none;
    text-align: left;
    width: 100%;
}

.sidebar-item svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    color: #4b5563;
}

/* Centralizar ícones quando colapsada */
.sidebar-modern.w-20 .sidebar-item {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.75rem !important;
}

.sidebar-modern.w-20 .sidebar-item svg {
    margin: 0 !important;
}

.sidebar-modern.w-20 .sidebar-item > div {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
}

.sidebar-item span {
    margin-left: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: #374151;
    transition: all 0.15s ease;
}

/* Hover nos menus principais */
.sidebar-item:hover span {
    color: #1f2937;
    font-weight: 600;
}

.sidebar-item:hover {
    text-decoration: none;
    outline: none;
}

/* Submenu Items */
.submenu-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.1rem;
    transition: all 0.15s;
    font-size: 0.75rem;
    margin-left: 0.5rem;
    background: transparent;
    text-decoration: none;
}

.submenu-item svg {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    color: #6b7280;
}

.submenu-item span {
    margin-left: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: #4b5563;
    transition: all 0.15s ease;
}

/* Hover nos submenus */
.submenu-item:hover span {
    color: #1f2937;
    font-weight: 600;
}

.submenu-item:hover {
    text-decoration: none;
    outline: none;
}

/* Dropdown Arrow */
.sidebar-item .dropdown-arrow {
    width: 1rem;
    height: 1rem;
    transition: transform 0.2s;
    color: #9ca3af;
}

.sidebar-item .dropdown-arrow.rotate-180 {
    transform: rotate(180deg);
}

/* Spacing */
.menu-section {
    margin-bottom: 0.25rem;
}

.submenu-container {
    margin-left: 0.5rem;
    margin-top: 0.5rem;
}

.submenu-container > * + * {
    margin-top: 0.5rem;
}

/* Remove underlines and outlines */
a {
    text-decoration: none !important;
}

a:hover,
a:focus,
button:hover,
button:focus {
    outline: none !important;
    text-decoration: none !important;
    border-bottom: none !important;
}

/* Admin Section */
.admin-section {
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

/* Alpine.js Transitions */
[x-cloak] {
    display: none !important;
}

/* Utility Classes */
.space-y-1 > * + * {
    margin-top: 0.25rem;
}

.space-y-2 > * + * {
    margin-top: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sidebar-modern {
        transform: translateX(-100%);
    }
    
    .sidebar-modern.mobile-open {
        transform: translateX(0);
    }
}
