/* Professional Minimal Sidebar Styles */

.shop-sidebar {
    width: 72px;
    background: linear-gradient(180deg, #FAFAFA 0%, #F5F5F5 100%);
    border-right: 1px solid #E5E7EB;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.02);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.shop-sidebar:hover {
    width: 200px;
}

.shop-sidebar .sidebar-brand {
    padding: 1.25rem 0.75rem;
    border-bottom: 1px solid #E5E7EB;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: padding 0.25s, justify-content 0.25s;
}

.shop-sidebar:hover .sidebar-brand {
    justify-content: flex-start;
    padding: 1.25rem 1rem;
}

.sidebar-brand {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid #E5E7EB;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo {
    height: 1rem;
    width: auto;
    max-width: 100%;
}

.shop-sidebar .sidebar-brand-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: #7B1FA2;
    letter-spacing: -0.05em;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    text-transform: none;
    white-space: nowrap;
    overflow: hidden;
    max-width: 0;
    opacity: 0;
    transition: max-width 0.3s, opacity 0.25s;
}

.shop-sidebar:hover .sidebar-brand-text {
    max-width: 120px;
    opacity: 1;
}

.sidebar-brand-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: #7B1FA2;
    letter-spacing: -0.05em;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    text-transform: none;
}

.sidebar-collapse {
    position: absolute;
    top: 0.625rem;
    right: 0.5rem;
    background: transparent;
    border: none;
    color: #6B7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-collapse:hover {
    background: #F3F4F6;
    color: #111827;
}

.collapse-icon {
    font-size: 0.625rem;
}

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

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

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

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 4px;
}

.shop-sidebar .sidebar-link {
    justify-content: center;
    padding: 0.5rem;
    margin: 0.5rem 0.375rem;
}

.shop-sidebar:hover .sidebar-link {
    justify-content: flex-start;
    padding: 0.5rem 0.75rem;
    margin: 0.5rem 0.5rem;
}

.shop-sidebar .sidebar-text {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 0.3s, opacity 0.25s;
}

.shop-sidebar:hover .sidebar-text {
    max-width: 140px;
    opacity: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin: 0.5rem 0.5rem;
    color: #4B5563;
    text-decoration: none;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 400;
    position: relative;
}

.sidebar-link:hover {
    background: #F9FAFB;
    color: #111827;
}

.sidebar-link.active {
    background: transparent;
}

.sidebar-link.active:hover {
    background: #F9FAFB;
}

.sidebar-icon {
    font-size: 0.5625rem;
    width: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.7;
}

.sidebar-link.active .sidebar-icon {
    color: #7B1FA2;
    opacity: 1;
}

.sidebar-text {
    flex: 1;
    letter-spacing: 0;
    font-weight: 400;
    color: inherit;
}

.sidebar-link.active .sidebar-text {
    color: #7B1FA2;
    font-weight: 400;
}

.sidebar-divider {
    height: 1px;
    background: #E5E7EB;
    margin: 0.375rem 0.625rem;
}

.sidebar-link-back {
    color: #7B1FA2;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.sidebar-link-back:hover {
    background: #F3E5F5;
    color: #6A1B9A;
}

.sidebar-logout {
    padding: 0.5rem 0.625rem;
    border-top: 1px solid #E5E7EB;
    background: white;
}

.sidebar-logout-btn {
    width: 100%;
    padding: 0.3125rem;
    background: transparent;
    color: #6B7280;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3125rem;
    font-weight: 200;
    font-size: 0.5625rem;
}

.sidebar-logout-btn:hover {
    background: #FEF2F2;
    color: #DC2626;
    border-color: #FCA5A5;
}

.sidebar-logout-btn .sidebar-icon {
    font-size: 0.5625rem;
}

.sidebar-logout-btn:active {
    transform: scale(0.98);
}

.shop-sidebar .sidebar-user {
    justify-content: center;
    padding: 0.875rem 0.5rem;
}

.shop-sidebar:hover .sidebar-user {
    justify-content: flex-start;
    padding: 0.875rem 0.875rem;
}

.shop-sidebar .user-info {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-width 0.3s, opacity 0.25s;
}

.shop-sidebar:hover .user-info {
    max-width: 120px;
    opacity: 1;
}

.shop-sidebar .sidebar-logout-btn {
    justify-content: center;
}

.shop-sidebar:hover .sidebar-logout-btn {
    justify-content: flex-start;
}

.sidebar-user {
    padding: 0.875rem 0.875rem;
    border-top: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: white;
}

.user-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 8px;
    background: linear-gradient(135deg, #7B1FA2 0%, #9C27B0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(123, 31, 162, 0.25);
}

.avatar-initial {
    color: white;
    font-weight: 600;
    font-size: 0.9375rem;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.user-email {
    font-size: 0.6875rem;
    font-weight: 400;
    color: #6B7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Main content margin when shop sidebar is sibling */
.shop-layout .shop-main {
    margin-left: 72px;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.shop-sidebar:hover ~ .shop-main {
    margin-left: 200px;
}

/* Responsive */
@media (max-width: 768px) {
    .shop-sidebar {
        width: 72px;
        transform: translateX(-100%);
        transition: transform 0.3s, width 0.3s;
    }

    .shop-sidebar:hover {
        width: 72px;
    }

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

    .shop-layout .shop-main {
        margin-left: 0;
    }

    .shop-sidebar:hover ~ .shop-main {
        margin-left: 0;
    }
}

/* Remove the side indicator */

/* Smooth transitions */
.sidebar-link,
.sidebar-icon,
.sidebar-text {
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus states for accessibility */
.sidebar-link:focus-visible {
    outline: 2px solid #7B1FA2;
    outline-offset: 2px;
}

.sidebar-collapse:focus-visible,
.sidebar-logout-btn:focus-visible {
    outline: 2px solid #7B1FA2;
    outline-offset: 2px;
}

/* Navigation Subsections */
.sidebar-section {
    margin-bottom: 0.25rem;
}

.sidebar-parent {
    position: relative;
    cursor: pointer;
}

.sidebar-parent .sidebar-arrow {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.2s ease;
    color: #6B7280;
    font-size: 0.75rem;
}

.sidebar-parent .sidebar-arrow.expanded {
    transform: translateY(-50%) rotate(180deg);
}

.sidebar-parent:hover .sidebar-arrow {
    color: #374151;
}

.sidebar-subsections {
    background: rgba(0, 0, 0, 0.03);
    border-left: 2px solid #E5E7EB;
    margin-left: 1rem;
    padding: 0.5rem 0;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
        padding: 0.5rem 0;
    }
}

.sidebar-sublink {
    display: flex;
    align-items: center;
    padding: 0.625rem 1rem;
    color: #6B7280;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0;
    margin: 0;
}

.sidebar-sublink:hover {
    background: rgba(123, 31, 162, 0.08);
    color: #7B1FA2;
    text-decoration: none;
}

.sidebar-sublink.active {
    background: rgba(123, 31, 162, 0.12);
    color: #7B1FA2;
    border-left: 3px solid #7B1FA2;
    font-weight: 600;
}

.sidebar-subicon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    font-size: 0.875rem;
    color: inherit;
}

.sidebar-subtext {
    font-size: 0.875rem;
    color: inherit;
    white-space: nowrap;
}

/* Responsive adjustments for subsections */
@media (max-width: 768px) {
    .sidebar-subsections {
        margin-left: 0.5rem;
    }
    
    .sidebar-sublink {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .sidebar-subicon {
        width: 1rem;
        height: 1rem;
        margin-right: 0.5rem;
        font-size: 0.75rem;
    }
}
