/* Beava Dual Sidebar Component */
/* Requires: beava_root.css */

/* Icon Bar - Always Visible */
.sidebar-icon-bar {
    position: fixed;
    left: 0;
    top: 60px;
    bottom: 0;
    width: 80px;
    background: var(--theme-bg-secondary, var(--ds-surface-dark));
    border-right: 1px solid var(--theme-border-light, var(--ds-border-light));
    z-index: 999;
    display: flex;
    flex-direction: column;
}

.sidebar-icon-list {
    flex: 1;
    padding: 0.5rem 0;
    overflow-y: auto;
}

.sidebar-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    min-height: 52px;
    color: var(--theme-text-muted, var(--ds-text-subtle));
    cursor: pointer;
    position: relative;
    transition: var(--transition-fast);
    border-left: 3px solid transparent;
    text-decoration: none;
    gap: 3px;
}

.sidebar-icon-item:hover {
    background: var(--theme-bg-hover, var(--ds-hover-gold));
    color: var(--theme-text-accent, var(--ds-text-gold));
    border-left-color: var(--theme-text-accent, var(--ds-text-gold));
}

.sidebar-icon-item.active {
    background: var(--theme-bg-hover, var(--ds-hover-gold-strong));
    color: var(--theme-text-accent, var(--ds-text-gold));
    border-left-color: var(--theme-text-accent, var(--ds-text-gold));
}

.sidebar-icon-item svg {
    flex-shrink: 0;
}

.sidebar-icon-item i {
    font-size: 1.25rem;
}

.sidebar-icon-label {
    font-size: 9px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    text-align: center;
    line-height: 1.1;
    max-width: 100%;
    white-space: nowrap;
    opacity: 0.85;
}

.sidebar-icon-item:hover .sidebar-icon-label {
    opacity: 1;
}

.sidebar-icon-item .notification-dot {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 8px;
    height: 8px;
    background: var(--ds-error);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* Toggle Button */
.sidebar-toggle-btn {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ds-bg-secondary);
    border-top: 1px solid var(--ds-border-light);
    color: var(--ds-text-subtle);
    cursor: pointer;
    transition: var(--transition-fast);
}

.sidebar-toggle-btn:hover {
    background: var(--ds-hover-gold);
    color: var(--ds-text-gold);
}

.sidebar-toggle-btn i {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

/* Detail Panel - Expandable */
.sidebar-detail-panel {
    position: fixed;
    left: 80px;
    top: 60px;
    bottom: 0;
    width: 280px;
    background: var(--theme-bg-tertiary, var(--ds-surface-brown));
    border-right: 1px solid var(--theme-border-light, var(--ds-border-light));
    z-index: 998;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-detail-panel.open {
    transform: translateX(0);
}

/* Detail Panel Header */
.sidebar-detail-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--ds-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-detail-title {
    font-size: 1.25rem;
    font-weight: var(--font-bold);
    color: var(--theme-text-heading, var(--ds-text-primary));
    margin: 0;
}

.sidebar-detail-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--ds-text-subtle);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: var(--transition-fast);
}

.sidebar-detail-close:hover {
    color: var(--ds-text-gold);
}

/* Detail Panel Content */
.sidebar-detail-content {
    padding: 1rem 0;
}

.sidebar-detail-section {
    margin-bottom: 0.5rem;
}

.sidebar-detail-section-title {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: var(--font-semibold);
    color: var(--ds-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-detail-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--theme-text-secondary, var(--ds-text-subtle));
    text-decoration: none;
    transition: var(--transition-fast);
    border-left: 3px solid transparent;
}

.sidebar-detail-item:hover {
    background: var(--theme-bg-hover, var(--ds-hover-gold));
    color: var(--theme-text-accent, var(--ds-text-gold));
    text-decoration: none;
    border-left-color: var(--theme-text-accent, var(--ds-text-gold));
}

.sidebar-detail-item.active {
    background: var(--ds-hover-gold-strong);
    color: var(--ds-text-primary);
    border-left-color: var(--ds-text-gold);
    font-weight: var(--font-semibold);
}

.sidebar-detail-item i {
    width: 20px;
    margin-right: 0.75rem;
    color: var(--ds-text-gold);
}

.sidebar-detail-item .badge {
    margin-left: auto;
    padding: 0.25rem 0.5rem;
    background: var(--ds-hover-gold);
    color: var(--ds-text-gold);
    font-size: 0.75rem;
    border-radius: 4px;
}

/* Main Content Adjustment */
body.dual-sidebar .content-area {
    margin-left: 80px;
    transition: margin-left 0.3s ease;
    min-height: calc(100vh - 60px);
    background: var(--ds-bg-primary);
}

body.dual-sidebar.sidebar-expanded .content-area {
    margin-left: 360px;
}

/* Collapsed State */
body.sidebar-collapsed .sidebar-detail-panel {
    display: none;
}

/* Tablet - Reduce widths */
@media (max-width: 1023px) and (min-width: 769px) {
    .sidebar-icon-bar {
        width: 56px;
    }
    .sidebar-icon-label {
        font-size: 8px;
    }
    .sidebar-icon-item {
        min-height: 48px;
        padding: 6px 2px;
    }
    .sidebar-icon-item svg {
        width: 18px;
        height: 18px;
    }
    .sidebar-detail-panel {
        left: 56px;
        width: 240px;
    }
    body.dual-sidebar .content-area {
        margin-left: 56px;
    }
    body.dual-sidebar.sidebar-expanded .content-area {
        margin-left: 296px;
    }
}

/* Mobile - Hamburger Menu */
@media (max-width: 768px) {
    /* Hide sidebar by default on mobile */
    .sidebar-icon-bar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 260px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1050;
        padding-top: 60px;
    }
    
    .sidebar-icon-bar.mobile-open {
        transform: translateX(0);
    }
    
    /* On mobile, show items in a list format */
    .sidebar-icon-item {
        flex-direction: row;
        justify-content: flex-start;
        padding: 12px 20px;
        min-height: auto;
        gap: 12px;
    }
    
    .sidebar-icon-label {
        font-size: 13px;
        text-transform: none;
        font-weight: 500;
    }
    
    .sidebar-icon-item svg {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }
    
    .sidebar-detail-panel {
        display: none;
    }
    
    body.dual-sidebar .content-area {
        margin-left: 0;
    }
    
    body.dual-sidebar.sidebar-expanded .content-area {
        margin-left: 0;
    }
    
    /* Mobile overlay when sidebar is open */
    .mobile-sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
    }
    
    .mobile-sidebar-overlay.active {
        display: block;
    }
}

/* Hamburger Button - Only visible on mobile */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    left: 8px;
    top: 8px;
    z-index: 1100;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--theme-text-muted, #999);
    padding: 0;
}

.mobile-menu-toggle:hover {
    background: var(--theme-bg-hover, rgba(255,255,255,0.08));
}

.mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}

.mobile-menu-toggle .hamburger-icon {
    display: block;
}

.mobile-menu-toggle .close-icon {
    display: none;
}

.mobile-menu-toggle.active .hamburger-icon {
    display: none;
}

.mobile-menu-toggle.active .close-icon {
    display: block;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
}

/* Scrollbar */
.sidebar-detail-panel::-webkit-scrollbar,
.sidebar-icon-list::-webkit-scrollbar {
    width: 6px;
}

.sidebar-detail-panel::-webkit-scrollbar-track,
.sidebar-icon-list::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-detail-panel::-webkit-scrollbar-thumb,
.sidebar-icon-list::-webkit-scrollbar-thumb {
    background: var(--ds-border-gold);
    border-radius: 3px;
}

.sidebar-detail-panel::-webkit-scrollbar-thumb:hover,
.sidebar-icon-list::-webkit-scrollbar-thumb:hover {
    background: var(--ds-border-gold-strong);
}
