/* Sidebar Toggle & User Profile Styles - FIXED */

/* 1. Top Right User Section */
#user-profile-widget {
    position: fixed;
    top: 1.5rem;
    right: 8.5rem;
    /* Moved left to avoid Theme Toggle */
    z-index: 2147483647 !important;
    /* Maximum possible Z-Index */
    display: flex;
    align-items: center;
    gap: 1rem;
    pointer-events: auto;
    /* Ensure clickable */
    animation: fadeInDown 0.5s ease-out;
}

#user-profile-widget .user-chip {
    background: rgba(45, 53, 97, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: white;
    z-index: 20000 !important;
}

/* Logged In Circle Style */
.user-chip-circle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-nebula-purple), var(--color-cyber-blue));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 20000 !important;
}

.user-chip-circle:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 0 25px rgba(6, 182, 212, 0.6);
}

#user-profile-widget .user-chip:hover {
    background: rgba(45, 53, 97, 1);
    border-color: var(--color-neon-cyan);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.3);
}

/* 2. Sidebar Toggle Button (Desktop & Mobile) */
#sidebar-toggle-btn {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    z-index: 1200;
    background: rgba(45, 53, 97, 0.8);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--color-text);
    /* Circular Style Updates */
    width: 45px;
    height: 45px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
}

#sidebar-toggle-btn:hover {
    background: var(--color-nebula-purple);
    color: white;
    transform: scale(1.1);
}

/* Ensure buttons wrap nicely on mobile if 3 are present */
.hero-cta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

/* Adjust Sidebar Header to make room for manual toggle button */
.sidebar .sidebar-header {
    padding-left: 5rem !important;
}

/* 3. Collapsible Sidebar Logic */
body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
}

body.sidebar-collapsed .main-content {
    margin-left: 0;
}

/* Smooth transitions */
.sidebar,
.main-content {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    #user-profile-widget {
        top: 1rem;
        right: 1rem;
    }

    #user-profile-widget .user-chip span:nth-child(2) {
        /* Hide text name on very small screens if needed, keeping icon */
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}