/* Sidebar */
.primary-sidebar {
    width: 300px;
    background: linear-gradient(180deg, rgba(26, 26, 46, 0.95), rgba(10, 10, 15, 0.95));
    backdrop-filter: blur(10px);
    padding: 25px;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 5;
    font-size: 14px;
    height: 100%;
    overflow: auto;
    transition: all 0.4s ease-in-out;
    transform: translateX(0);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    border-right: 1px solid rgba(255, 0, 255, 0.2);
    box-shadow: 5px 0 15px rgba(255, 0, 255, 0.1);
}

.sidebar-header {
    margin-top: 75px;
    margin-bottom: 25px;
    text-align: center;
    position: relative;
}

.sidebar-header img {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    border: 3px solid #ff00ff;
    box-shadow: 0 0 25px #ff00ff;
    transition: all 0.3s ease;
}

.sidebar-header img:hover {
    transform: scale(1.05);
    box-shadow: 0 0 35px #ff00ff;
}

.username {
    color: #ff80ff;
    font-size: 1.2em;
    text-align: center;
    margin: 10px 0;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    width: 100%;
}

.sidebar-nav ul li {
    padding: 10px;
    font-size: 13px;
    margin-bottom: 8px;
    text-align: center;
    background: rgba(34, 34, 34, 0.6);
    border-radius: 10px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 0, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sidebar-nav ul li i {
    color: #ff00ff;
    font-size: 14px;
    width: 20px;
    text-align: center;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.3);
}

.sidebar-nav ul li strong {
    color: #ff80ff;
    margin-right: 5px;
}

.sidebar-nav ul li:hover {
    background: rgba(255, 0, 255, 0.1);
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.2);
    transform: translateY(-2px);
    border-color: rgba(255, 0, 255, 0.3);
}

.admin-button {
    list-style: none;
    text-align: center;
}
.admin-button a.btn-warning {
    background: linear-gradient(90deg, #ffe066 0%, #ffd600 100%);
    color: #222 !important;
    border: 2px solid #ffd600;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(255, 214, 0, 0.15);
    transition: box-shadow 0.2s, background 0.2s;
    text-shadow: 0 0 8px #fffbe6;
    letter-spacing: 1px;
    font-size: 1em;
    padding: 0px;
    border-radius: 5px;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
}
.admin-button a.btn-warning:hover,
.admin-button a.btn-warning:focus {
    background: linear-gradient(90deg, #ffd600 0%, #ffe066 100%);
    box-shadow: 0 4px 16px rgba(255, 214, 0, 0.25);
    color: #222 !important;
    text-decoration: none;
    filter: brightness(1.1);
}

/* Radio Player Styling */
.sidebar-radio-player {
    width: 100%;
    background: rgba(20, 20, 40, 0.8);
    padding: 12px;
    border-radius: 15px;
    margin-top: 20px;
    border: 1px solid rgba(255, 0, 255, 0.2);
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.1);
}

.audio-title {
    color: #ff80ff;
    font-size: 1em;
    text-align: center;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
}

.radio-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

#play-pause, #volume-btn {
    background: linear-gradient(45deg, #ff00ff, #8707ff);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.4);
    transition: all 0.3s ease;
    padding: 0;
    font-size: 12px;
}

#play-pause:hover, #volume-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(255, 0, 255, 0.6);
}

.volume-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

#volume-slider {
    width: 80%;
    height: 3px;
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff00ff;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.6);
    transition: all 0.3s ease;
}

#volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.8);
}

#current-time, #total-time {
    font-size: 0.8em;
    color: #ff80ff;
}

/* NAVIGATION MENU */

/* Sidebar button */
.sidebar-toggle {
    position: fixed;
    top: 15px;
    left: 25px;
    z-index: 1000;
    background: linear-gradient(135deg, #ff1493, #8a2be2);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(255, 20, 147, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.sidebar-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 20, 147, 0.8);
}

.sidebar-toggle.active {
    background: linear-gradient(135deg, #8a2be2, #ff1493);
}

/* Sidebar Hidden State */
.primary-sidebar.sidebar-hidden {
    transform: translateX(-100%);
    opacity: 0;
}

/* Body State When Sidebar is Collapsed */
body.sidebar-collapsed .rpg-content {
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    max-width: 1200px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .sidebar-toggle {
        top: 10px;
        left: 10px;
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .primary-sidebar {
        width: 250px;
    }
}

/* FRIENDS SIDEBAR (RIGHT) */
.friends-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 270px;
    height: 100vh;
    background: linear-gradient(#0a0a0f, #1a1a2e);
    border-left: 1px solid rgba(255, 0, 255, 0.2);
    box-shadow: -5px 0 15px rgba(255, 0, 255, 0.1);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    transition: transform 0.4s ease-in-out;
}
.friends-sidebar.sidebar-hidden {
    transform: translateX(100%);
    opacity: 0;
}
.friends-sidebar .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 18px 8px 18px;
    margin-top: 60px;
    margin-bottom: 0;
    font-size: 1.2em;
    color: #ff80ff;
    border-bottom: 1px solid rgba(255,0,255,0.08);
    background: none;
}
.friends-sidebar .sidebar-toggle.right-toggle {
    background: linear-gradient(135deg, #ff1493, #8a2be2);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 0 10px #ff00ff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}
.friends-sidebar .sidebar-toggle.right-toggle:hover {
    background: linear-gradient(135deg, #8a2be2, #ff1493);
    color: #fff;
}
.friends-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0 10px 0;
}
.friend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    border-bottom: 1px solid rgba(255,0,255,0.04);
    font-size: 13px;
    transition: background 0.2s;
}
.friend-item:last-child {
    border-bottom: none;
}
.friend-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ff00ff;
    box-shadow: 0 0 10px #ff00ff44;
}
.friend-name {
    color: #fff;
    font-weight: 600;
    flex: 1;
    text-shadow: 0 0 7px #ff00ff33;
}
.friend-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-left: 6px;
    box-shadow: 0 0 7px #00ff88;
    border: 2px solid #222;
    background: #888;
    transition: background 0.2s;
}
.friend-status.online {
    background: #00ff88;
}
.friend-status.offline {
    background: #444;
}
.no-friends {
    color: #ff80ff;
    text-align: center;
    margin-top: 40px;
    font-size: 14px;
}
@media (max-width: 900px) {
    .friends-sidebar {
        width: 100vw;
        min-width: 0;
        max-width: 100vw;
    }
}

/* Sidebar Logout Button Styles */
.sidebar-logout-form {
    width: 100%;
    margin-top: 32px;
    display: flex;
    justify-content: center;
}
.sidebar-logout-btn {
    width: 90%;
    background: linear-gradient(90deg, #ff0077 0%, #8707ff 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 2px 16px rgba(255, 0, 128, 0.20);
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
}
.sidebar-logout-btn i {
    font-size: 1.2em;
    color: #fff;
    text-shadow: 0 0 8px #ff00ff;
}
.sidebar-logout-btn:hover, .sidebar-logout-btn:focus {
    background: linear-gradient(90deg, #8707ff 0%, #ff0077 100%);
    box-shadow: 0 4px 24px rgba(255, 0, 255, 0.25);
    transform: translateY(-2px) scale(1.04);
    outline: none;
}

/* --- Enhanced Mobile Styles for Sidebar --- */
@media (max-width: 900px) {
    .primary-sidebar {
        width: 100vw;
        min-width: 0;
        max-width: 100vw;
        left: 0;
        border-radius: 0 0 20px 20px;
        padding: 14px 6px;
        box-shadow: 0 8px 24px rgba(255,0,255,0.13);
    }
    .sidebar-header {
        margin-top: 38px;
        margin-bottom: 15px;
    }
    .sidebar-header img {
        width: 90px;
        height: 90px;
    }
    .sidebar-nav ul {
        margin: 12px 0;
    }
    .sidebar-nav ul li {
        font-size: 1em;
        padding: 7px;
        margin-bottom: 7px;
        border-radius: 8px;
    }
    .username {
        font-size: 1em;
        margin: 6px 0;
    }
    .sidebar-radio-player {
        padding: 8px;
        margin-top: 12px;
        border-radius: 10px;
    }
    .admin-button a.btn-warning {
        font-size: 0.98em;
        padding: 7px 10px;
        border-radius: 6px;
    }
    .sidebar-logout-btn {
        font-size: 1em;
        padding: 10px 0;
        border-radius: 7px;
    }
    .friends-sidebar {
        width: 100vw;
        min-width: 0;
        max-width: 100vw;
        right: 0;
        border-radius: 0 0 20px 20px;
        padding: 10px 4px;
    }
    .friend-item {
        padding: 7px 8px;
        font-size: 0.98em;
        gap: 8px;
    }
    .friend-avatar {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 600px) {
    .primary-sidebar, .friends-sidebar {
        padding: 7px 2px;
        border-radius: 0 0 10px 10px;
    }
    .sidebar-header img {
        width: 60px;
        height: 60px;
    }
    .sidebar-header {
        margin-top: 16px;
        margin-bottom: 8px;
    }
    .sidebar-nav ul li {
        font-size: 0.95em;
        padding: 6px;
        border-radius: 6px;
    }
    .sidebar-logout-btn {
        font-size: 0.98em;
        padding: 8px 0;
        border-radius: 6px;
    }
    .friend-item {
        padding: 5px 5px;
        font-size: 0.96em;
        gap: 6px;
    }
    .friend-avatar {
        width: 22px;
        height: 22px;
    }
}
/* --- End Enhanced Mobile Styles for Sidebar --- */

/* --- Off-canvas Sidebar & Overlay for Mobile (Improved Mutual Exclusion) --- */
@media (max-width: 900px) {
    .primary-sidebar,
    .friends-sidebar {
        position: fixed;
        top: 0;
        height: 100vh;
        z-index: 120;
        transition: transform 0.35s cubic-bezier(.4,2,.6,1), box-shadow 0.2s, opacity 0.2s;
        box-shadow: 0 0 32px rgba(255,0,255,0.14);
        opacity: 0;
        pointer-events: none;
    }
    .primary-sidebar.sidebar-open {
        left: 0;
        transform: translateX(0);
        border-radius: 0 18px 18px 0;
        opacity: 1;
        pointer-events: auto;
        z-index: 121;
    }
    .primary-sidebar {
        left: 0;
        transform: translateX(-100%);
        border-radius: 0 18px 18px 0;
    }
    .friends-sidebar.sidebar-open {
        right: 0;
        left: auto;
        transform: translateX(0);
        border-radius: 18px 0 0 18px;
        opacity: 1;
        pointer-events: auto;
        z-index: 121;
    }
    .friends-sidebar {
        right: 0;
        left: auto;
        transform: translateX(100%);
        border-radius: 18px 0 0 18px;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(18,18,30,0.78);
        z-index: 120;
        transition: opacity 0.25s;
        opacity: 0;
    }
    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }
}
/* --- End Off-canvas Sidebar & Overlay (Improved) --- */
