/* User Sidebar Custom Styles */
:root {
    --primary-color: #4f46e5;
    --primary-dark: #3730a3;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    --sidebar-width: 280px;
    --header-height: 70px;
    --user-sidebar-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --user-sidebar-hover: rgba(255,255,255,0.1);
    --user-sidebar-active: rgba(255,255,255,0.15);
}

/* Customer theme (default) - inherits from body */
/* Customer theme uses default colors - no overrides needed */

/* Professional theme inherits from body */
/* Professional theme styles are in professional-theme.css */

/* User Sidebar Styles */
.user-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: var(--user-sidebar-bg);
    color: white;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transform: translateX(-100%);
}

.user-sidebar.show,
.user-sidebar.active {
    transform: translateX(0);
}

.user-sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    background: rgba(0,0,0,0.1);
}

.sidebar-header img {
    max-width: 120px;
    height: auto;
    transition: transform 0.3s ease;
}

.sidebar-header img:hover {
    transform: scale(1.05);
}

.sidebar-menu {
    padding: 1rem 0;
}

.menu-item {
    margin: 0.25rem 0;
    position: relative;
    min-height: auto;
}

/* Ensure consistent spacing between parent menu items */
.menu-item.has-submenu {
    margin: 0.25rem 0;
}

/* Prevent submenu from affecting parent menu item spacing */
.menu-item.has-submenu > .submenu {
    margin-top: 0;
    margin-bottom: 0;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    position: relative;
    cursor: pointer;
    border-radius: 0 25px 25px 0;
    margin-right: 1rem;
}

.menu-link:hover {
    background-color: var(--user-sidebar-hover);
    color: white;
    border-left-color: #fbbf24;
    transform: translateX(5px);
    box-shadow: inset 0 0 20px rgba(255,255,255,0.1);
}

.menu-link.active {
    background-color: var(--user-sidebar-active);
    color: white;
    border-left-color: #fbbf24;
    border-left-width: 4px;
    box-shadow: inset 0 0 20px rgba(255,255,255,0.1);
    font-weight: 600;
    position: relative;
}

.menu-link.active::after {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background-color: #fbbf24;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
}

.menu-link.has-submenu {
    position: relative;
}

.menu-link.has-submenu::after {
    content: '';
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid rgba(255,255,255,0.7);
    transition: transform 0.3s ease;
}

.menu-icon {
    width: 20px;
    margin-right: 0.75rem;
    text-align: center;
    transition: all 0.3s ease;
}

.menu-text {
    flex: 1;
    font-weight: 500;
    transition: all 0.3s ease;
}

.menu-arrow {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: auto;
}

.menu-arrow.rotated {
    transform: rotate(90deg);
}

.submenu {
    background-color: rgba(0,0,0,0.1);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    border-radius: 0 0 15px 0;
    margin-right: 1rem;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.submenu.show {
    max-height: 1000px;
    opacity: 1;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.submenu .menu-link {
    padding-left: 3rem;
    font-size: 0.9rem;
    position: relative;
    margin-right: 0;
    border-radius: 0 20px 20px 0;
}

.submenu .menu-link::before {
    content: '';
    position: absolute;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.5);
    transition: all 0.3s ease;
}

.submenu .menu-link:hover::before {
    background-color: #fbbf24;
    transform: translateY(-50%) scale(1.2);
}

.submenu .menu-link.active::before {
    background-color: #fbbf24;
    width: 8px;
    height: 8px;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
}

.submenu .menu-link.active {
    background-color: rgba(255,255,255,0.2);
    border-left-color: #fbbf24;
    border-left-width: 3px;
    font-weight: 600;
}

/* Parent menu arrow rotation when submenu is open */
.menu-item.has-open-submenu .menu-link.has-submenu::after {
    transform: translateY(-50%) rotate(90deg);
}

/* Main Content */
.user-main {
    margin-left: 0;
    min-height: 100vh;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
}

.user-main.sidebar-open {
    margin-left: var(--sidebar-width);
}

/* Header */
.user-header {
    background: white;
    height: var(--header-height);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-left {
    display: flex;
    align-items: center;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--secondary-color);
    cursor: pointer;
    margin-right: 1rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.sidebar-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background-color: var(--primary-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    z-index: -1;
}

.sidebar-toggle:hover {
    background-color: var(--light-color);
    color: var(--primary-color);
    transform: scale(1.1);
}

.sidebar-toggle:hover::before {
    width: 100%;
    height: 100%;
    background-color: rgba(79, 70, 229, 0.1);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
}

.user-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Content Area */
.user-content {
    padding: 2rem;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Desktop - Sidebar always visible */
@media (min-width: 769px) {
    .user-sidebar {
        transform: translateX(0);
        position: fixed;
    }
    
    .user-main {
        margin-left: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
        max-width: calc(100vw - var(--sidebar-width));
    }
    
    .sidebar-toggle {
        display: none;
    }
    
    .sidebar-overlay {
        display: none;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .user-sidebar {
        transform: translateX(-100%);
        width: 100%;
        max-width: 320px;
    }

    .user-sidebar.show,
    .user-sidebar.active {
        transform: translateX(0);
        box-shadow: 0 0 20px rgba(0,0,0,0.3);
        z-index: 1050;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.5);
        z-index: 1049;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    .sidebar-overlay.active,
    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }

    .user-main {
        margin-left: 0;
    }

    .user-main.sidebar-open {
        margin-left: 0;
    }

    .user-content {
        padding: 1rem;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .user-header {
        padding: 0 1rem;
        min-height: 60px;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .header-left {
        flex: 1;
        min-width: 0;
    }

    .header-right {
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .user-info span {
        display: none;
    }

    .sidebar-header {
        padding: 1rem;
    }

    .sidebar-header img {
        max-width: 100px;
        height: auto;
    }

    .menu-link {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        min-height: 44px;
    }

    .submenu .menu-link {
        padding-left: 3.5rem;
        min-height: 44px;
    }

    .page-title {
        font-size: clamp(1.1rem, 4vw, 1.25rem);
        line-height: 1.3;
        word-wrap: break-word;
    }
    
    .sidebar-toggle {
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem;
        flex-shrink: 0;
    }
    
    .notification-btn,
    .user-avatar {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Tablet Responsive */
@media (max-width: 1024px) and (min-width: 769px) {
    :root {
        --sidebar-width: 260px;
    }
    
    .user-sidebar {
        width: var(--sidebar-width);
    }

    .user-main {
        margin-left: var(--sidebar-width);
        width: calc(100% - var(--sidebar-width));
        max-width: calc(100vw - var(--sidebar-width));
    }

    .menu-link {
        padding: 0.75rem 1.25rem;
        min-height: 44px;
    }
    
    .user-content {
        padding: 1.5rem;
    }
}

/* Overlay for mobile */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-overlay.show,
.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Custom scrollbar */
.user-sidebar::-webkit-scrollbar {
    width: 6px;
}

.user-sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

.user-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

.user-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

/* Enhanced hover effects */
.menu-link:hover .menu-icon {
    transform: scale(1.1);
    color: #fbbf24;
}

.menu-link:hover .menu-text {
    transform: translateX(2px);
}

/* Active state improvements */
.menu-link.active .menu-icon {
    color: #fbbf24;
    transform: scale(1.15);
    filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.5));
}

.menu-link.active .menu-text {
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* Parent menu styling when submenu is open (but not active) */
.menu-item.has-open-submenu > .menu-link.has-submenu {
    background-color: rgba(255,255,255,0.05);
}

/* Only mark parent as active if it's explicitly active (not just because submenu is open) */
.menu-item.has-open-submenu > .menu-link.has-submenu.active {
    background-color: var(--user-sidebar-active);
    border-left-color: #fbbf24;
    border-left-width: 4px;
}

/* Smooth transitions for all interactive elements */
.menu-item {
    transition: all 0.3s ease;
}

.menu-item:hover {
    transform: translateX(2px);
}

/* Focus states for accessibility */
.menu-link:focus {
    outline: 2px solid #fbbf24;
    outline-offset: 2px;
}

.sidebar-toggle:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Language switcher in sidebar */
.sidebar-language-switcher {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: auto;
}

.language-switcher .btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    transition: all 0.3s ease;
}

.language-switcher .btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-1px);
}

/* User profile section in sidebar */
.sidebar-user-profile {
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.1);
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: white;
}

.sidebar-user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.sidebar-user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.sidebar-user-details h6 {
    margin: 0;
    font-weight: 600;
    font-size: 1rem;
}

.sidebar-user-details small {
    opacity: 0.8;
    font-size: 0.85rem;
}

/* Responsive utilities */
@media (max-width: 576px) {
    .user-content {
        padding: 0.5rem;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .menu-link {
        padding: 0.75rem 1rem;
    }

    .submenu .menu-link {
        padding-left: 3rem;
    }
    
    .sidebar-user-profile {
        padding: 0.75rem;
    }
    
    .sidebar-user-avatar {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}
