/* sidebar.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

:root {
    --primary: #4361ee;
    --primary-light: #4895ef;
    --secondary: #3f37c9;
    --dark: #2b2d42;
    --light: #f8f9fa;
    --gray: #adb5bd;
    --success: #4cc9f0;
    --warning: #f72585;
    --danger: #e63946;
    --success-bg: #d1fae5;
    --pending-bg: #fef3c7;
    --processing-bg: #dbeafe;
    --sidebar-width: 260px;
    --bottom-nav-height: 80px;
}

/* Desktop Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    color: white;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    padding: 25px 20px;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.logo {
    display: flex;
    align-items: center;
    margin-bottom: 40px;
    padding: 0;
    min-height: 45px;
    gap: 12px;
    flex-wrap: nowrap;
}

.logo-icon {
    font-size: 28px;
    background: rgba(255, 255, 255, 0.2);
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: visible;
    flex: 0 1 auto;
}

.nav-menu {
    list-style: none;
    flex-grow: 1;
}

.nav-item {
    margin-bottom: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateX(5px);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: white;
    border-radius: 0 4px 4px 0;
}

.nav-icon {
    font-size: 22px;
    margin-right: 15px;
    width: 24px;
    text-align: center;
}

.nav-text {
    font-size: 16px;
    font-weight: 500;
}

.cart-badge, .orders-badge {
    background: var(--warning);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: bold;
    margin-left: auto;
}

.orders-badge {
    background: var(--danger);
}

.user-profile {
    display: flex;
    align-items: center;
    padding: 15px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
    cursor: pointer;
    position: relative;
}

.demo-sidebar-cta {
    margin: 8px 0 12px;
    padding: 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.24);
}

.demo-sidebar-cta p {
    margin: 0 0 8px;
    font-size: 12px;
    color: #ffffff;
    opacity: 0.95;
}

.demo-sidebar-cta a {
    display: inline-block;
    text-decoration: none;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(231, 76, 60, 0.92);
}

.demo-sidebar-cta a:hover {
    background: rgba(231, 76, 60, 1);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 18px;
    overflow: hidden;
    position: relative;
}

.user-avatar-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
}

.user-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.user-info {
    flex-grow: 1;
}

.user-name {
    font-weight: 600;
    font-size: 15px;
}

.user-role {
    font-size: 12px;
    opacity: 0.8;
}

.user-menu {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 75px;
    background: white;
    color: var(--dark);
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    z-index: 1001;
}

.user-menu-item {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--dark);
    font-weight: 600;
    padding: 10px 12px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.user-menu-item:hover {
    background: rgba(67, 97, 238, 0.12);
    color: var(--primary);
}

.user-menu-item.is-logout {
    color: var(--danger);
}

.user-menu-item.is-logout:hover {
    background: rgba(230, 57, 70, 0.12);
    color: var(--danger);
}

.user-session-actions {
    display: flex;
    align-items: stretch;
    gap: 6px;
}

.user-session-actions .user-menu-item {
    width: auto;
}

.user-session-actions #userMenuAction {
    flex: 9;
    justify-content: center;
}

.user-theme-toggle {
    flex: 1;
    min-width: 36px;
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.user-theme-toggle i {
    font-size: 16px;
}

.user-menu-languages {
    display: flex;
    gap: 8px;
    padding: 6px 4px 10px;
}

.user-menu-lang-btn {
    flex: 1;
    border: 1px solid #d9dce3;
    border-radius: 8px;
    background: #f6f8ff;
    color: #2f3a4f;
    font-weight: 700;
    font-size: 12px;
    padding: 8px 10px;
    cursor: pointer;
}

.user-menu-lang-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

/* Mobile Bottom Navigation */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 10px 0;
}

.nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    list-style: none;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--gray);
    padding: 8px 12px;
    border-radius: 16px;
    transition: all 0.3s ease;
    position: relative;
}

.mobile-nav-item.active {
    color: var(--primary);
}

.mobile-nav-item:hover {
    color: var(--primary);
    background: rgba(67, 97, 238, 0.1);
}

.mobile-nav-icon {
    font-size: 22px;
    margin-bottom: 4px;
}

.mobile-nav-text {
    font-size: 12px;
    font-weight: 500;
}

.mobile-cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--warning);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 10px;
    font-weight: bold;
}

/* Floating Cart Button for Mobile */
.floating-cart {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.4);
    transition: all 0.3s ease;
    position: relative;
    bottom: 15px;
}

.floating-cart:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(67, 97, 238, 0.5);
}

.floating-cart .mobile-nav-icon {
    font-size: 24px;
    margin-bottom: 0;
}

/* Mobile Menu Toggle - Hidden (bottom nav handles sidebar) */
.menu-toggle {
    display: none !important;
}

/* Add to sidebar.css for notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

.notification.error {
    background: #ef4444;
}

.notification.info {
    background: #3b82f6;
}

.notification .close-notification {
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.notification .close-notification:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Mobile Ribbon Styles */
.mobile-ribbon {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
    z-index: 1002;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.mobile-ribbon.mobile-ribbon-hidden {
    transform: translateY(-110%);
}

.mobile-title {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex: 1;
    text-align: left;
}

.mobile-actions {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-user-trigger-initials,
.mobile-user-initials {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.mobile-user-trigger-img,
.mobile-user-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: none;
}

.mobile-user {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 24px;
}

.mobile-user:hover,
.mobile-user:focus-visible {
    background: rgba(255, 255, 255, 0.25);
    outline: none;
}

.mobile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #ffffff;
    color: #1f2933;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    padding: 12px;
    min-width: 200px;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1500;
    pointer-events: none;
}

.mobile-dropdown.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.mobile-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 10px;
    margin-bottom: 10px;
}

.mobile-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    overflow: hidden;
}

.mobile-user-name {
    font-weight: 600;
    color: #1f2933;
    font-size: 14px;
}

.mobile-user-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mobile-user-role {
    font-size: 12px;
    color: #4b5563;
    font-weight: 600;
}

.mobile-language-actions {
    display: flex;
    gap: 6px;
}

.mobile-language-btn {
    flex: 1;
    border: 1px solid #d8dee9;
    border-radius: 8px;
    background: #f4f7ff;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
    padding: 8px 10px;
    cursor: pointer;
}

.mobile-language-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.mobile-auth-btn {
    width: 100%;
    text-decoration: none;
    border: none;
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.mobile-session-actions {
    display: flex;
    align-items: stretch;
    gap: 6px;
    width: 100%;
}

.mobile-session-actions .mobile-auth-btn {
    flex: 9;
    width: auto;
}

.mobile-theme-btn {
    flex: 1;
    min-width: 38px;
    border-radius: 8px;
    border: 1px solid #d8dee9;
    background: #f4f7ff;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-theme-btn i {
    font-size: 16px;
}

.mobile-theme-btn:hover,
.mobile-theme-btn:focus-visible {
    background: #e8eefb;
    border-color: #93c5fd;
    outline: none;
}

.mobile-logout-btn {
    width: 100%;
    border: none;
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

/* Responsive Design */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .mobile-ribbon {
        display: flex !important;
    }
    
    .bottom-nav {
        display: block;
    }
    
    body {
        padding-top: 56px;
    }
}

@media (max-width: 480px) {
    .bottom-nav {
        padding: 8px 0;
    }
    
    .mobile-nav-item {
        padding: 6px 8px;
    }
    
    .mobile-nav-icon {
        font-size: 20px;
    }
    
    .mobile-nav-text {
        font-size: 10px;
    }
    
    .floating-cart {
        width: 55px;
        height: 55px;
        bottom: 10px;
    }
    
    .floating-cart .mobile-nav-icon {
        font-size: 22px;
    }
}

html[data-theme='dark'] .sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #111827 48%, #020617 100%);
    box-shadow: 8px 0 26px rgba(2, 6, 23, 0.42);
}

html[data-theme='dark'] .logo-icon,
html[data-theme='dark'] .user-avatar,
html[data-theme='dark'] .mobile-user {
    background: rgba(148, 163, 184, 0.2);
}

html[data-theme='dark'] .nav-link {
    color: rgba(226, 232, 240, 0.86);
}

html[data-theme='dark'] .nav-link:hover,
html[data-theme='dark'] .nav-link.active {
    background: rgba(59, 130, 246, 0.24);
    color: #f8fafc;
}

html[data-theme='dark'] .demo-sidebar-cta {
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(96, 165, 250, 0.42);
}

html[data-theme='dark'] .demo-sidebar-cta p {
    color: #e2e8f0;
}

html[data-theme='dark'] .demo-sidebar-cta a {
    background: rgba(239, 68, 68, 0.9);
}

html[data-theme='dark'] .user-profile {
    border-top-color: rgba(148, 163, 184, 0.25);
}

html[data-theme='dark'] .user-menu,
html[data-theme='dark'] .mobile-dropdown {
    background: #111827;
    color: #e2e8f0;
    box-shadow: 0 16px 32px rgba(2, 6, 23, 0.5);
    border: 1px solid #334155;
}

html[data-theme='dark'] .user-menu-item {
    color: #e2e8f0;
}

html[data-theme='dark'] .user-menu-item:hover {
    background: rgba(59, 130, 246, 0.22);
    color: #bfdbfe;
}

html[data-theme='dark'] .user-menu-item.is-logout,
html[data-theme='dark'] .user-menu-item.is-logout:hover {
    color: #fca5a5;
}

html[data-theme='dark'] .user-menu-item.is-logout:hover {
    background: rgba(239, 68, 68, 0.2);
}

html[data-theme='dark'] .user-theme-toggle {
    background: #111827;
    border-color: #334155;
    color: #e2e8f0;
}

html[data-theme='dark'] .user-theme-toggle:hover {
    background: rgba(59, 130, 246, 0.22);
    border-color: #3b82f6;
    color: #bfdbfe;
}

html[data-theme='dark'] .user-menu-lang-btn,
html[data-theme='dark'] .mobile-language-btn {
    border-color: #334155;
    background: #0f172a;
    color: #cbd5e1;
}

html[data-theme='dark'] .user-menu-lang-btn.active,
html[data-theme='dark'] .mobile-language-btn.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

html[data-theme='dark'] .bottom-nav {
    background: #0f172a;
    box-shadow: 0 -8px 24px rgba(2, 6, 23, 0.48);
    border-top: 1px solid #334155;
}

html[data-theme='dark'] .mobile-nav-item {
    color: #94a3b8;
}

html[data-theme='dark'] .mobile-nav-item.active,
html[data-theme='dark'] .mobile-nav-item:hover {
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.18);
}

html[data-theme='dark'] .floating-cart {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 8px 18px rgba(29, 78, 216, 0.44);
}

html[data-theme='dark'] .mobile-ribbon {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    box-shadow: 0 8px 18px rgba(2, 6, 23, 0.45);
}

html[data-theme='dark'] .mobile-user-card {
    background: linear-gradient(135deg, #0f172a 0%, #1f2937 100%);
}

html[data-theme='dark'] .mobile-user-name {
    color: #e2e8f0;
}

html[data-theme='dark'] .mobile-user-role {
    color: #94a3b8;
}

html[data-theme='dark'] .mobile-auth-btn,
html[data-theme='dark'] .mobile-logout-btn {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

html[data-theme='dark'] .mobile-theme-btn {
    background: #111827;
    border-color: #334155;
    color: #e2e8f0;
}

html[data-theme='dark'] .mobile-theme-btn:hover,
html[data-theme='dark'] .mobile-theme-btn:focus-visible {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    color: #bfdbfe;
}

html[data-theme='dark'] .notification {
    box-shadow: 0 10px 20px rgba(2, 6, 23, 0.45);
}