/* === CHANNEL SIDEBAR STYLES === */

/* Sidebar Container */
.pp-channel-sidebar {
    background: linear-gradient(90deg, rgba(227, 236, 255, 0.30) 12.28%, #E3ECFF 202.46%);
    padding: 24px 0;
    overflow: visible;
    height: fit-content;
}

.theme-dark .pp-channel-sidebar {
    background: linear-gradient(90deg, #010F29 12.28%, #001337 202.46%);
}

/* Sidebar Profile/Title Section */
.pp-sidebar-profile {
    padding: 0 20px 20px;
}

.pp-sidebar-section-title {
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 8px 0;
}

.pp-sidebar-profile .pp-sidebar-section-title {
    font-size: 20px;
    font-weight: 700;
}

.pp-sidebar-section-title::after {
    content: '';
    display: block;
    width: 30px;
    height: 2px;
    background: var(--accent);
    margin-top: 6px;
}

/* Balance */
.pp-sidebar-balance {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 16px 0 4px;
}

.pp-sidebar-balance-value {
    font-family: 'Open Sans', sans-serif;
    font-size: 45px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}

.pp-sidebar-balance-label {
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    color: var(--muted);
}

.pp-sidebar-balance-text {
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    color: var(--muted);
}

/* Sidebar Navigation */
.pp-sidebar-nav {
    display: flex;
    flex-direction: column;
}

/* Sidebar Sections */
.pp-sidebar-section {
    padding: 0 20px;
    margin-bottom: 10px;
    overflow: visible;
    position: relative;
    z-index: 0;
}

.pp-sidebar-section .pp-sidebar-section-title {
    margin-bottom: 14px;
}

.pp-sidebar-section .pp-sidebar-section-title::after {
    display: none;
}

/* Section Title Gradient (Video, Channels) */
.pp-sidebar-title-gradient {
    color: var(--accent);
    background: #D4E2FF;
    margin-left: -20px;
    margin-right: -20px;
    padding: 10px 20px;
}

.theme-dark .pp-sidebar-title-gradient {
    color: var(--accent);
    background: linear-gradient(90deg, #010F29 0%, #04183D 49.04%, #011336 100%);
    margin-left: -20px;
    margin-right: -20px;
    padding: 10px 20px;
}

/* Menu */
.pp-sidebar-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: visible;
}

/* Links */
.pp-sidebar-link {
    display: flex;
    align-items: center;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    line-height: 35px;
    color: var(--muted);
    text-decoration: none;
    border-radius: 0;
    transition: all 0.2s;
}

.pp-sidebar-link:hover {
    color: var(--accent);
}

.pp-sidebar-link.is-active {
    background: transparent;
    color: #ffffff;
    border-radius: 0;
    position: relative;
}

.pp-sidebar-link.is-active::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -20px;
    right: -20px;
    background: var(--primary);
    z-index: -1;
}

/* === MOBILE ELEMENTS (hidden on desktop) === */
.pp-sidebar-mobile-toggle,
.pp-sidebar-overlay,
.pp-sidebar-close {
    display: none;
}

/* === RESPONSIVE === */
@media (max-width: 1600px) {
    .pp-channel-sidebar {
        padding: 20px 0;
    }

    .pp-sidebar-profile {
        padding: 0 16px 16px;
    }

    .pp-sidebar-section {
        padding: 0 16px;
    }

    .pp-sidebar-title-gradient {
        margin-left: -16px;
        margin-right: -16px;
        padding: 10px 16px;
    }

    .pp-sidebar-link.is-active::before {
        left: -16px;
        right: -16px;
    }
}

@media (max-width: 1100px) {
    .pp-sidebar-profile {
        padding: 0 14px 14px;
    }

    .pp-sidebar-section {
        padding: 0 14px;
    }

    .pp-sidebar-title-gradient {
        margin-left: -14px;
        margin-right: -14px;
        padding: 10px 14px;
    }

    .pp-sidebar-link.is-active::before {
        left: -14px;
        right: -14px;
    }
}

/* === MOBILE DRAWER (767px and below) === */
@media (max-width: 767px) {
    /* Mobile Toggle Button */
    .pp-sidebar-mobile-toggle {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 16px 16px 0 16px;
        background: transparent;
        cursor: pointer;
        color: var(--text);
    }

    .pp-sidebar-mobile-toggle svg {
        flex-shrink: 0;
    }

    .pp-sidebar-mobile-title {
        font-family: 'Open Sans', sans-serif;
        font-size: 18px;
        font-weight: 700;
        text-transform: uppercase;
        color: var(--text);
    }

    /* Overlay */
    .pp-sidebar-overlay {
        display: block;
        position: fixed;
        top: 100px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .pp-sidebar-overlay.is-visible {
        opacity: 1;
        visibility: visible;
    }

    /* Sidebar as Drawer */
    .pp-channel-sidebar {
        position: fixed;
        top: 100px;
        left: 0;
        width: 280px;
        max-width: 85vw;
        height: calc(100vh - 100px);
        height: calc(100dvh - 100px);
        z-index: 999;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        padding-top: 0;
        background: #E3ECFF;
    }

    .theme-dark .pp-channel-sidebar {
        background: #010B1F;
    }

    .pp-channel-sidebar.is-open {
        transform: translateX(0) !important;
    }

    /* Close Button */
    .pp-sidebar-close {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        padding: 16px 20px;
        background: transparent;
        border: none;
        cursor: pointer;
        color: var(--text);
        font-family: 'Open Sans', sans-serif;
        font-size: 18px;
        font-weight: 700;
        text-transform: uppercase;
    }

    .pp-sidebar-close svg {
        flex-shrink: 0;
    }

    /* Hide desktop title in profile section */
    .pp-sidebar-desktop-title {
        display: none;
    }

    .pp-sidebar-profile {
        padding: 0 20px 16px;
    }

    /* Show title underline only if balance is shown */
    .pp-sidebar-profile .pp-sidebar-section-title::after {
        display: none;
    }

    .pp-sidebar-section {
        padding: 0 20px;
    }

    .pp-sidebar-title-gradient {
        margin-left: -20px;
        margin-right: -20px;
        padding: 10px 20px;
    }

    .pp-sidebar-link.is-active::before {
        left: -20px;
        right: -20px;
    }
}