﻿/* ============================================
   POSTEX CRM - Sidebar
   Premium Dark Tech Theme - elosool.com
   ============================================ */

.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    background: var(--panel-blue-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-left: 1px solid var(--panel-blue-border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: var(--transition);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Subtle pattern overlay on sidebar */
.sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, transparent 28%, transparent 72%, rgba(255, 255, 255, 0.03) 100%);
    pointer-events: none;
    z-index: 0;
}

/* Glowing accent line on left border */
.sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg,
            transparent 0%,
            rgba(64, 211, 255, 0.5) 20%,
            rgba(131, 230, 255, 0.8) 50%,
            rgba(64, 211, 255, 0.5) 80%,
            transparent 100%);
    box-shadow: 0 0 15px rgba(64, 211, 255, 0.35), 0 0 30px rgba(131, 230, 255, 0.16);
    z-index: 1;
}

/* Logo */
.sidebar-logo {
    padding: 14px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(64, 211, 255, 0.22);
    min-height: 56px;
    position: relative;
    z-index: 1;
    background: linear-gradient(180deg, rgba(131, 230, 255, 0.10) 0%, transparent 100%);
}

.sidebar-logo-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}

/* Glow ring behind logo */
.sidebar-logo-icon::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.4), rgba(0, 184, 212, 0.2));
    filter: blur(4px);
    z-index: -1;
}

.sidebar-logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 12px rgba(0, 229, 255, 0.5));
}

.sidebar-logo-text {
    display: flex;
    flex-direction: column;
}

.sidebar-logo-name {
    font-weight: 800;
    font-size: 1rem;
    color: #ffffff;
    line-height: 1.2;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.15));
}

.sidebar-logo-name .brand-osool-word {
    color: #11e8ff;
    text-shadow: 0 0 12px rgba(17, 232, 255, 0.34);
}

.sidebar-logo-name .brand-rest-word {
    color: #ffffff;
}

.sidebar-logo-desc {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.88);
    font-weight: 700;
    letter-spacing: 0.3px;
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    padding: 8px;
    position: relative;
    z-index: 1;
}

.sidebar-section {
    margin-bottom: 8px;
}

.sidebar-section-title {
    display: block;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    color: rgba(191, 219, 254, 0.68);
    margin: 10px 8px 6px;
    text-transform: uppercase;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.92);
    transition: var(--transition);
    margin-bottom: 2px;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    font-size: 0.82rem;
    font-weight: 700;
    border: 1px solid transparent;
    white-space: nowrap;
}

.sidebar-item:hover {
    color: #ffffff;
    background: rgba(0, 229, 255, 0.08);
    border-color: rgba(0, 229, 255, 0.1);
    transform: translateX(-4px);
}

.sidebar-item.active {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.9), rgba(0, 184, 212, 0.9));
    color: white;
    font-weight: 800;
    box-shadow: 0 4px 24px rgba(0, 229, 255, 0.35), 0 0 50px rgba(0, 229, 255, 0.1);
    border-color: transparent;
    transform: translateX(-2px);
}

/* Active item glow effect */
.sidebar-item.active::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.6), rgba(0, 184, 212, 0.3));
    filter: blur(8px);
    z-index: -1;
    opacity: 0.5;
}

.sidebar-item i {
    width: 18px;
    text-align: center;
    font-size: 0.88rem;
    flex-shrink: 0;
}

.sidebar-item .item-badge {
    margin-right: auto;
    margin-left: 0;
    background: var(--accent);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 22px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 229, 255, 0.3);
}

.sidebar-item.active .item-badge {
    background: rgba(255, 255, 255, 0.25);
    box-shadow: none;
}

.sidebar-item-featured {
    background: linear-gradient(135deg, rgba(121, 80, 242, 0.18), rgba(14, 165, 233, 0.08));
    border-color: rgba(147, 112, 255, 0.24);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sidebar-item-featured:hover {
    background: linear-gradient(135deg, rgba(121, 80, 242, 0.26), rgba(14, 165, 233, 0.12));
    border-color: rgba(177, 153, 255, 0.34);
}

.sidebar-item-featured.active {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.95), rgba(59, 130, 246, 0.88));
    box-shadow: 0 8px 26px rgba(105, 72, 221, 0.34), 0 0 42px rgba(96, 165, 250, 0.12);
}

.item-badge-new {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.95), rgba(249, 115, 22, 0.95));
    color: #fff;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.26);
}

/* Logout */
.sidebar-footer {
    padding: 8px;
    border-top: 1px solid rgba(0, 229, 255, 0.12);
    position: relative;
    z-index: 1;
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.95);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 800;
    width: 100%;
    border: 1px solid transparent;
    background: none;
    font-family: var(--font);
}

.sidebar-logout:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
}

.sidebar-logout i {
    width: 20px;
    text-align: center;
}

/* Mobile overlay */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============ MOBILE ============ */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(110%);
        z-index: 1000;
        width: 220px;
        box-shadow: none;
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: -20px 0 60px rgba(0,0,0,0.8);
    }

    .sidebar-item {
        padding: 11px 12px;
        font-size: 0.84rem;
        min-height: 42px;
    }

    .sidebar-logout {
        min-height: 42px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        width: 100vw;
        border-radius: 0;
    }
}

/* ============ POSTEX SIDEBAR OVERRIDES ============ */
.sidebar {
    background: var(--panel-blue-bg) !important;
    border-left-color: rgba(255, 255, 255, 0.08) !important;
}

.sidebar::after {
    background: rgba(255, 255, 255, 0.08) !important;
    box-shadow: none !important;
}

.sidebar-logo {
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
    background: rgba(255, 255, 255, 0.025) !important;
}

.sidebar-logo-icon {
    background: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    box-shadow: none !important;
}

.sidebar-logo-icon::before {
    display: none !important;
}

.sidebar-logo-icon img {
    filter: none !important;
}

.sidebar-logo-name .brand-osool-word,
.sidebar-logo-name .brand-postex-word {
    color: var(--postex-orange-2) !important;
    text-shadow: none !important;
}

.sidebar-logo-name .brand-rest-word,
.sidebar-logo-desc {
    color: #ffffff !important;
}

.sidebar-section-title {
    color: rgba(255, 232, 214, 0.68) !important;
}

.sidebar-item:hover {
    background: rgba(244, 123, 54, 0.12) !important;
    border-color: rgba(244, 123, 54, 0.2) !important;
}

.sidebar-item.active,
.sidebar-item-featured.active {
    background: linear-gradient(135deg, #ff9957, #f47b36) !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

.sidebar-item.active::before {
    display: none !important;
}

.sidebar-item-featured {
    background: rgba(244, 123, 54, 0.08) !important;
    border-color: rgba(244, 123, 54, 0.2) !important;
}

.sidebar-footer {
    border-top-color: rgba(244, 123, 54, 0.16) !important;
}
