/* User Sidebar Custom Styles */
:root {
    --primary-color: #1d4ed8;
    --primary-dark: #1e40af;
    --secondary-color: #6b7280;
    --success-color: #1d4ed8;
    --warning-color: #1d4ed8;
    --danger-color: #9c2b2b;
    --light-color: #f8fafc;
    --dark-color: #0f172a;
    --sidebar-width: 280px;
    --header-height: 70px;
    --user-sidebar-bg: #ffffff;
    --user-sidebar-hover: #f3f4f6;
    --user-sidebar-active: #e8eefc;
    --sidebar-border: #e5e7eb;
    --sidebar-text: #111827;
    --sidebar-text-muted: #6b7280;
    --sidebar-accent: #1d4ed8;
}

/* 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: var(--sidebar-text);
    z-index: 1000;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    border-right: 1px solid var(--sidebar-border);
    transform: translateX(-100%);
}

.user-sidebar.show,
.user-sidebar.active {
    transform: translateX(0);
}

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

.sidebar-header {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid var(--sidebar-border);
    text-align: left;
    background: var(--user-sidebar-bg);
}

.sidebar-header img {
    max-width: 150px;
    display: block;
    margin: 0;
    height: auto;
    transition: transform 0.25s ease;
}

.sidebar-header img:hover {
    transform: scale(1.05);
}

.sidebar-menu {
    padding: 0.75rem 0.75rem 1rem;
}

.menu-item {
    margin: 0.125rem 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;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    color: var(--sidebar-text-muted);
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
    border-radius: 10px;
    margin: 0;
}

.menu-link::before {
    content: '';
    position: absolute;
    left: -0.75rem;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 999px;
    background: transparent;
    transition: background 0.2s ease;
}

.menu-link:hover {
    background-color: var(--user-sidebar-hover);
    color: var(--sidebar-accent);
    box-shadow: none;
}

.menu-link:hover .menu-icon {
    color: var(--sidebar-accent);
    background: rgba(29, 78, 216, 0.1);
}

.menu-link.active {
    background-color: var(--user-sidebar-active);
    color: var(--sidebar-accent);
    box-shadow: none;
    font-weight: 600;
    position: relative;
}

.menu-link.active::before {
    background: var(--sidebar-accent);
}

/* Remove dot indicator */
.menu-link.active::after {
    display: none !important;
}

.menu-link.has-submenu {
    position: relative;
}

.menu-link.has-submenu::after {
    content: none;
}

.menu-icon {
    width: 32px;
    height: 32px;
    text-align: center;
    transition: all 0.25s ease;
    border-radius: 8px;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--sidebar-text-muted);
    font-size: 1rem;
}

.menu-text {
    flex: 1;
    font-weight: 500;
    transition: color 0.2s ease;
}

.menu-arrow {
    transition: transform 0.25s ease;
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--sidebar-text-muted);
}

.menu-arrow.rotated {
    transform: rotate(90deg);
}

.submenu {
    background-color: transparent;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    border-radius: 0;
    margin: 0.15rem 0.75rem 0.45rem 1.6rem;
    padding: 0;
    border-left: 1px solid var(--sidebar-border);
}

.submenu.show {
    max-height: 1000px;
    opacity: 1;
    padding: 0.25rem 0 0.35rem 0.5rem;
}

.submenu .menu-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    position: relative;
    margin-right: 0;
    border-radius: 8px;
}

.submenu .menu-link::before {
    content: none;
}

/* Remove bullet points from submenu items */
.submenu .menu-link::before {
    display: none !important;
}

.submenu .menu-link.active {
    background-color: rgba(29, 78, 216, 0.12);
    font-weight: 600;
    color: var(--sidebar-accent);
}

.submenu .menu-link.active .menu-icon {
    color: var(--sidebar-accent);
    background: rgba(29, 78, 216, 0.1);
}

/* Parent menu arrow color when submenu is open */
.menu-item.has-open-submenu .menu-arrow {
    color: var(--sidebar-accent);
}

/* 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: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 999;
    border-bottom: 1px solid #eef2f7;
}

.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;
    height: 44px;
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 600;
    transition: all 0.3s ease;
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: none;
}

.user-info span {
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.user-info .dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* 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: none;
        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 1rem 0.85rem;
    }

    .sidebar-header img {
        max-width: 130px;
        height: auto;
    }

    .menu-link {
        padding: 0.85rem 1rem;
        font-size: 1rem;
        min-height: 44px;
    }

    .submenu .menu-link {
        padding: 0.7rem 0.85rem;
        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: transparent;
}

.user-sidebar::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.5);
    border-radius: 3px;
}

.user-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.8);
}

/* Enhanced hover effects */
/* Hover effects are now in .menu-link:hover above */

/* Active state improvements */
.menu-link.active .menu-icon {
    color: var(--sidebar-accent);
    background: rgba(29, 78, 216, 0.12);
    transform: scale(1);
}

.menu-link.active .menu-text {
    font-weight: 600;
    color: var(--sidebar-accent);
}

/* Parent menu styling when submenu is open (but not active) */
.menu-item.has-open-submenu>.menu-link.has-submenu {
    background-color: var(--user-sidebar-hover);
}

/* 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);
}

/* Smooth transitions for all interactive elements */
.menu-item {
    transition: background 0.2s ease;
}

/* Focus states for accessibility */
.menu-link:focus {
    outline: 2px solid #013DC4;
    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 var(--sidebar-border);
    margin-top: auto;
}

.language-switcher .btn {
    background: #ffffff;
    border: 1px solid var(--sidebar-border);
    color: var(--sidebar-text);
    transition: all 0.2s ease;
}

.language-switcher .btn:hover {
    background: var(--user-sidebar-hover);
    transform: translateY(-1px);
}

/* User profile section in sidebar */
.sidebar-user-profile {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--sidebar-border);
    background: var(--user-sidebar-bg);
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--sidebar-text);
    min-width: 0;
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--sidebar-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sidebar-user-avatar:hover {
    transform: scale(1.02);
    box-shadow: none;
}

.sidebar-user-details h6 {
    margin: 0;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
    word-break: break-word;
    color: var(--sidebar-text);
}

.sidebar-user-details small {
    opacity: 0.7;
    font-size: 0.8rem;
    display: block;
    line-height: 1.2;
    color: var(--sidebar-text-muted);
}

/* Responsive utilities */
@media (max-width: 576px) {
    .user-content {
        padding: 0.5rem;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .menu-link {
        padding: 0.7rem 0.9rem;
    }

    .submenu .menu-link {
        padding: 0.65rem 0.8rem;
    }

    .sidebar-user-profile {
        padding: 0.75rem;
    }

    .sidebar-user-avatar {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* ================================
   Customer Sidebar Final Overrides
   ================================ */
.theme-customer .user-sidebar {
    background: var(--user-sidebar-bg);
    color: var(--sidebar-text);
    border-right: 1px solid var(--sidebar-border);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.theme-customer .user-sidebar .sidebar-header {
    padding: 1.25rem 1.25rem 1rem;
    text-align: left;
    background: var(--user-sidebar-bg);
    border-bottom: 1px solid var(--sidebar-border);
}

.theme-customer .user-sidebar .sidebar-user-profile {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--sidebar-border);
    background: var(--user-sidebar-bg);
}

.theme-customer .user-sidebar .sidebar-user-avatar {
    background: var(--sidebar-accent);
}

.theme-customer .user-sidebar .sidebar-menu {
    padding: 0.75rem 0.75rem 1rem;
}

.theme-customer .user-sidebar .menu-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    margin: 0;
    color: var(--sidebar-text-muted);
    border-radius: 10px;
    text-decoration: none;
    position: relative;
    box-shadow: none;
}

.theme-customer .user-sidebar .menu-link::before {
    content: '';
    position: absolute;
    left: -0.75rem;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 999px;
    background: transparent;
    transition: background 0.2s ease;
}

.theme-customer .user-sidebar .menu-link:hover {
    background: var(--user-sidebar-hover);
    color: var(--sidebar-accent);
}

.theme-customer .user-sidebar .menu-link.active {
    background: var(--user-sidebar-active);
    color: var(--sidebar-accent);
    font-weight: 600;
}

.theme-customer .user-sidebar .menu-link.active::before {
    background: var(--sidebar-accent);
}

.theme-customer .user-sidebar .menu-link.active::after {
    display: none !important;
}

.theme-customer .user-sidebar .menu-link:focus,
.theme-customer .user-sidebar .menu-link:focus-visible {
    outline: none;
    box-shadow: none;
}

.theme-customer .user-sidebar .menu-link:focus:not(:focus-visible) {
    box-shadow: none;
}

.theme-customer .user-sidebar .menu-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--sidebar-text-muted);
    font-size: 1rem;
}

.theme-customer .user-sidebar .menu-link:hover .menu-icon,
.theme-customer .user-sidebar .menu-link.active .menu-icon {
    color: var(--sidebar-accent);
    background: rgba(29, 78, 216, 0.12);
}

.theme-customer .user-sidebar .menu-arrow {
    font-size: 0.85rem;
    color: var(--sidebar-text-muted);
}

.theme-customer .user-sidebar .menu-item.has-open-submenu .menu-arrow {
    color: var(--sidebar-accent);
}

.theme-customer .user-sidebar .submenu {
    background: transparent;
    border-left: 1px solid var(--sidebar-border);
    margin: 0.15rem 0.75rem 0.45rem 1.6rem;
    padding: 0;
}

.theme-customer .user-sidebar .submenu.show {
    padding: 0.25rem 0 0.35rem 0.5rem;
}

.theme-customer .user-sidebar .submenu .menu-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    border-radius: 8px;
}

.theme-customer .user-sidebar .submenu .menu-icon {
    display: none;
}

.theme-customer .user-sidebar .submenu .menu-link.active {
    background: rgba(29, 78, 216, 0.12);
    color: var(--sidebar-accent);
    font-weight: 600;
}

/* ================================
   Minimal Sidebar Reset (Global)
   ================================ */
.user-sidebar {
    background: #ffffff !important;
    color: #111827;
    border-right: 1px solid #e5e7eb;
    box-shadow: none !important;
}

.user-sidebar .sidebar-header,
.user-sidebar .sidebar-user-profile {
    background: #ffffff !important;
    border-bottom: 1px solid #e5e7eb;
}

.user-sidebar .sidebar-header {
    padding: 1rem 1.25rem 0.75rem;
    text-align: left;
}

.user-sidebar .sidebar-header img {
    max-width: 140px;
    margin: 0;
}

.user-sidebar .sidebar-user-profile {
    padding: 0.75rem 1.25rem;
}

.user-sidebar .sidebar-user-avatar {
    background: #111827;
    color: #ffffff;
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
}

.user-sidebar .sidebar-menu {
    padding: 0.5rem 0.75rem 1rem;
}

.user-sidebar .menu-item {
    margin: 0.15rem 0;
}

.user-sidebar .menu-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    margin: 0;
    border-radius: 6px;
    color: #6b7280;
    background: transparent;
    border: none;
    box-shadow: none;
}

.user-sidebar .menu-link::before,
.user-sidebar .menu-link::after {
    content: none !important;
}

.user-sidebar .menu-link:hover {
    background: #f3f4f6;
    color: #111827;
}

.user-sidebar .menu-link.active {
    background: #eef2ff;
    color: #111827;
    font-weight: 600;
    border-left: 0 !important;
}

.user-sidebar .menu-link:focus,
.user-sidebar .menu-link:focus-visible {
    outline: none;
    box-shadow: none;
}

.user-sidebar .menu-icon {
    width: 22px;
    height: 22px;
    font-size: 0.9rem;
    background: transparent;
    color: inherit;
}

.user-sidebar .menu-arrow {
    font-size: 0.8rem;
    color: #9ca3af;
}

.user-sidebar .submenu {
    background: transparent;
    border-left: 1px solid #e5e7eb;
    margin: 0.2rem 0.5rem 0.4rem 1.25rem;
    padding: 0;
    border-radius: 0;
}

.user-sidebar .submenu.show {
    padding: 0.25rem 0 0.35rem 0.5rem;
}

.user-sidebar .submenu .menu-link {
    padding: 0.45rem 0.6rem;
    font-size: 0.9rem;
    border-radius: 6px;
}

.user-sidebar .submenu .menu-icon {
    display: none;
}

.user-sidebar .submenu .menu-link.active {
    background: #eef2ff;
    color: #111827;
    font-weight: 600;
}
