/* ========================================================
   FIXED VIEWPORT & INDEPENDENT SCROLLING LAYOUT
   ======================================================== */
.profile-page-wrapper {
    height: calc(100vh - 60px);
    overflow: hidden; 
    background-color: var(--bg-main);
}

.profile-layout {
    display: flex;
    height: 100%;
    width: 100%;
}

/* ========================================================
   LEFT SIDEBAR NAVIGATION
   ======================================================== */
.profile-sidenav {
    width: 280px;
    min-width: 280px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    height: 100%;
    overflow-y: auto;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Custom Scrollbar */
.profile-sidenav::-webkit-scrollbar,
.profile-content-area::-webkit-scrollbar {
    width: 6px;
}

.profile-sidenav::-webkit-scrollbar-track,
.profile-content-area::-webkit-scrollbar-track {
    background: var(--bg-main);
}

.profile-sidenav::-webkit-scrollbar-thumb,
.profile-content-area::-webkit-scrollbar-thumb {
    background: var(--border-highlight);
    border-radius: 3px;
}

.user-profile-summary {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.avatar-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--purple-glow));
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-summary-details {
    overflow: hidden;
}

.user-summary-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-summary-role {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Nav Groups & Links */
.profile-nav-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.profile-nav-heading {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.2rem 0.5rem;
}

.profile-nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.profile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.825rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    cursor: pointer;
}

.profile-nav-link:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.profile-nav-link.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    border-left: 3px solid var(--primary);
    font-weight: 600;
}

.nav-badge-count {
    margin-left: auto;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.68rem;
    padding: 1px 6px;
    border-radius: 10px;
}

/* Logout Button */
.logout-nav-item {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.logout-link {
    color: #EF4444;
}

.logout-link:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

/* ========================================================
   RIGHT MAIN CONTENT AREA
   ======================================================== */
.profile-content-area {
    flex-grow: 1;
    height: 100%;
    overflow-y: auto;
    padding: 2.5rem 3rem;
}

.profile-section-panel {
    display: none;
    max-width: 800px;
    margin: 0 auto;
}

.profile-section-panel.active {
    display: block;
}

.panel-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.panel-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
}

.panel-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

/* Bookmarks Feed Cards */
.bookmark-items-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.bookmark-item-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: border-color 0.2s ease;
}

.bookmark-item-card:hover {
    border-color: var(--border-highlight);
}

.bookmark-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.bookmark-item-type {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 0.3rem;
}

.bookmark-item-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.bookmark-remark-box {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-left: 3px solid #F59E0B;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.825rem;
    color: var(--text-secondary);
}

.bookmark-remark-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #F59E0B;
    text-transform: uppercase;
    margin-bottom: 0.2rem;
}

.bookmark-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 0.65rem;
}

.remove-bookmark-btn {
    background: transparent;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
}

.remove-bookmark-btn:hover {
    text-decoration: underline;
}

/* Responsive Handling */
@media (max-width: 991px) {
    .profile-page-wrapper {
        height: auto;
        overflow: visible;
    }

    .profile-layout {
        flex-direction: column;
    }

    .profile-sidenav {
        width: 100%;
        min-width: 100%;
        height: auto;
        max-height: 350px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .profile-content-area {
        height: auto;
        padding: 1.5rem 1rem;
    }
}