@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=SF+Pro+Display:wght@300;400;600;700&display=swap');

body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #0D0D0F 0%, #1A1A2E 100%);
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Vazirmatn', sans-serif;
    display: flex;
    height: 100vh;
    overflow: hidden;
    direction: rtl;
    backdrop-filter: blur(20px);
}

/* ================= SIDEBAR ================= */
#sidebar {
    width: 280px;
    background: rgba(20, 20, 24, 0.8);
    backdrop-filter: blur(30px) saturate(180%);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    color: #ccc;
    direction: ltr;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#sidebar-header {
    padding: 20px;
    text-align: center;
    background: rgba(27, 28, 34, 0.9);
    backdrop-filter: blur(40px);
    font-weight: 700;
    color: #7B2FF7;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0 0 20px 20px;
}

.category {
    padding: 15px 20px;
    font-size: 12px;
    color: rgba(109, 109, 120, 0.8);
    margin-top: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.channel, .voice-channel {
    padding: 15px 20px;
    cursor: pointer;
    color: #c9c9d1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 16px;
    margin: 4px 8px;
    backdrop-filter: blur(10px);
}

.channel:hover, .voice-channel:hover {
    background: rgba(123, 47, 247, 0.2);
    backdrop-filter: blur(20px) saturate(200%);
    border-right: 4px solid rgba(123, 47, 247, 0.5);
    color: #fff;
    transform: translateX(-2px);
}

.channel.active, .voice-channel.active {
    background: rgba(123, 47, 247, 0.3);
    backdrop-filter: blur(30px);
    border-right: 5px solid #7B2FF7;
    color: #fff;
    box-shadow: 0 4px 20px rgba(123, 47, 247, 0.2);
}

.voice-channel {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.voice-channel .vc-name {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 15px;
    font-weight: 500;
}

.voice-channel .vc-users {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 3px;
    padding-right: 6px;
}

.voice-user-mini img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid rgba(123, 47, 247, 0.6);
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}


#sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 12px;
}
#sidebar-scroll .category,
#sidebar-scroll .channel,
#sidebar-scroll .voice-channel {
    direction: rtl;
    text-align: right;
}

#sidebar-scroll,
#chat-box,
#voice-panel {
    scrollbar-width: thin;
    scrollbar-color: rgba(42, 42, 53, 0.5) rgba(20, 20, 24, 0.8);
}

/* Chrome / Edge / Safari */
#sidebar-scroll::-webkit-scrollbar,
#chat-box::-webkit-scrollbar,
#voice-panel::-webkit-scrollbar {
    width: 6px;
}

#sidebar-scroll::-webkit-scrollbar-track,
#chat-box::-webkit-scrollbar-track,
#voice-panel::-webkit-scrollbar-track {
    background: rgba(20, 20, 24, 0.5);
    backdrop-filter: blur(10px);
}

#sidebar-scroll::-webkit-scrollbar-thumb,
#chat-box::-webkit-scrollbar-thumb,
#voice-panel::-webkit-scrollbar-thumb {
    background: rgba(42, 42, 53, 0.7);
    border-radius: 999px;
    backdrop-filter: blur(10px);
}

#sidebar-scroll::-webkit-scrollbar-thumb:hover,
#chat-box::-webkit-scrollbar-thumb:hover,
#voice-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(58, 58, 69, 0.8);
}
/* ================= USER PANEL ================= */
#user-panel {
    padding: 15px;
    background: rgba(27, 28, 34, 0.9);
    backdrop-filter: blur(40px);
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    border-top: 1px solid rgba(42, 42, 53, 0.5);
    flex-shrink: 0;
    border-radius: 20px 20px 0 0;
    margin: 0 8px 8px;
}

#user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 3px solid rgba(123, 47, 247, 0.6);
    box-shadow: 0 4px 16px rgba(123, 47, 247, 0.2);
    transition: all 0.3s ease;
}

#user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(123, 47, 247, 0.3);
}

#user-info {
    margin-right: 12px;
}

#username-display {
    font-weight: 600;
    color: #eee;
}

#status-display {
    font-size: 13px;
    color: rgba(123, 123, 133, 0.8);
}

#status-menu {
    position: absolute;
    right: 60px;
    bottom: 50px;
    background: rgba(27, 28, 34, 0.95);
    backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    display: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

#status-menu div {
    padding: 12px 16px;
    font-size: 14px;
    transition: all 0.2s ease;
}

#status-menu div:hover {
    background: rgba(123,47,247,0.2);
    backdrop-filter: blur(20px);
    transform: translateX(-2px);
}

/* ================= MAIN CHAT ================= */
#main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#header {
    background: rgba(20, 20, 24, 0.8);
    backdrop-filter: blur(30px);
    padding: 20px;
    border-bottom: 1px solid rgba(31, 31, 35, 0.5);
    color: #ECECEC;
    font-size: 20px;
    font-weight: 600;
    border-radius: 0 0 20px 0;
}

#chat-box {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: rgba(13, 13, 15, 0.6);
    backdrop-filter: blur(20px);
}

/* Chat bubbles */
.message {
    background: rgba(27, 28, 34, 0.9);
    backdrop-filter: blur(20px);
    padding: 15px 18px;
    margin-bottom: 12px;
    border-radius: 24px;
    width: fit-content;
    max-width: 65%;
    animation: liquidFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.message:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.message .author {
    font-size: 15px;
    font-weight: 700;
    color: #9D4DFF;
    margin-bottom: 6px;
}

.message.self {
    background: rgba(123, 47, 247, 0.2);
    backdrop-filter: blur(30px);
    margin-right: auto;
    color: #fff;
    border: 1px solid rgba(123, 47, 247, 0.2);
}

@keyframes liquidFadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px) scale(0.95); 
        filter: blur(5px);
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
        filter: blur(0);
    }
}

/* Chat Input */
#chat-input {
    padding: 15px 20px;
    display: flex;
    background: rgba(20, 20, 24, 0.8);
    backdrop-filter: blur(30px);
    border-top: 1px solid rgba(31, 31, 35, 0.5);
    gap: 10px;
}

#chat-input input {
    flex: 1;
    padding: 14px 18px;
    background: rgba(15, 15, 18, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    outline: none;
    color: #fff;
    font-size: 15px;
    transition: all 0.3s ease;
}

#chat-input input:focus {
    border-color: rgba(123, 47, 247, 0.4);
    box-shadow: 0 0 0 3px rgba(123, 47, 247, 0.1);
    transform: scale(1.02);
}

#send-btn {
    margin-right: 0;
    padding: 14px 24px;
    border-radius: 20px;
    border: none;
    background: rgba(123, 47, 247, 0.8);
    backdrop-filter: blur(20px);
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#send-btn:hover {
    background: rgba(123, 47, 247, 1);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(123, 47, 247, 0.3);
}

/* ================= VOICE PANEL ================= */
#voice-panel {
    width: 280px;
    background: rgba(20, 20, 24, 0.8);
    backdrop-filter: blur(30px);
    border-right: 1px solid rgba(31, 31, 35, 0.5);
    padding: 20px;
    display: flex;
    flex-direction: column;
    color: #ccc;
    overflow-y: auto;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.3);
}

#voice-room-title {
    font-size: 18px;
    font-weight: 700;
    color: #7B2FF7;
    margin-bottom: 15px;
    text-align: center;
}

/* Users in voice */
.voice-user {
    background: rgba(27, 28, 34, 0.9);
    backdrop-filter: blur(20px);
    padding: 15px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.voice-user:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.voice-user img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(123, 47, 247, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.voice-user .name {
    margin-right: 12px;
    font-weight: 600;
    color: #fff;
    font-size: 15px;
}

.speaking {
    box-shadow: 0 0 20px rgba(66, 255, 123, 0.6);
    background: rgba(66, 255, 123, 0.1);
    border-color: rgba(66, 255, 123, 0.3);
    transform: scale(1.02);
}

#voice-controls button {
    width: 100%;
    padding: 14px;
    background: rgba(123, 47, 247, 0.8);
    backdrop-filter: blur(20px);
    border: none;
    border-radius: 20px;
    color: #fff;
    cursor: pointer;
    margin-top: 10px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 15px;
}

#voice-controls button:hover:not(:disabled) {
    background: rgba(123, 47, 247, 1);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(123, 47, 247, 0.3);
}

#voice-controls button:disabled {
    background: rgba(42, 42, 53, 0.5);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}


.voice-user-mini {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    margin-top: 4px;
    background: rgba(123, 47, 247, 0.15);
    backdrop-filter: blur(10px);
    padding: 4px 8px;
    border-radius: 12px;
    border: 1px solid rgba(123, 47, 247, 0.2);
}

.voice-user-mini img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-left: 6px;
    border: 2px solid rgba(123, 47, 247, 0.6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.voice-user-mini .mini-name {
    font-size: 12px;
    color: #ddd;
    font-weight: 500;
}