/* Discord-Style Layout Fixes */

/* Channel List Sidebar Styling - Modern Design */
.channel-list-sidebar {
    display: flex;
    flex-direction: column;
    background: rgba(12, 18, 32, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: none;
    border-right: none;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 8px 32px rgba(0, 0, 0, 0.3);
    height: 100%;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.channel-list-sidebar.switching {
    opacity: 0.6;
    transform: translateX(-4px);
}

.channel-list-header {
    padding: 1.75rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.channel-list-header h3 {
    color: #ffffff;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    letter-spacing: -0.02em;
}

.channel-list-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.25rem 1rem 1.5rem 1.25rem;
}

.channel-category {
    margin-bottom: 2.5rem;
}

.channel-category:last-child {
    margin-bottom: 1.5rem;
}

.channel-category-header {
    padding: 0 1rem 0.875rem 1.25rem;
    color: rgba(255, 255, 255, 0.55);
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-family: 'Inter', sans-serif;
    margin-bottom: 0.5rem;
    transition: color 0.2s ease;
}

.channel-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.125rem;
    margin: 0.375rem 0.25rem;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 15px;
    font-weight: 500;
    position: relative;
}

.channel-item.switching {
    opacity: 0.5;
    pointer-events: none;
}

.channel-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95);
    transform: translateX(6px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.channel-item.active {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.25) 0%, rgba(34, 197, 94, 0.2) 100%);
    color: #ffffff;
    border-left: 4px solid #4ade80;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 4px 12px rgba(74, 222, 128, 0.2),
        inset -1px 0 0 rgba(74, 222, 128, 0.3);
    font-weight: 600;
    transform: translateX(2px);
    animation: channelActivate 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes channelActivate {
    0% {
        transform: translateX(0);
        background: rgba(255, 255, 255, 0.05);
    }
    50% {
        transform: translateX(4px);
    }
    100% {
        transform: translateX(2px);
    }
}

.channel-icon {
    font-size: 18px;
    font-weight: 400;
    opacity: 0.7;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.channel-item:hover .channel-icon {
    opacity: 0.85;
}

.channel-item.active .channel-icon {
    opacity: 1;
    transform: scale(1.05);
}

.channel-name {
    flex: 1;
    font-weight: 600;
    letter-spacing: -0.01em;
    transition: font-weight 0.2s ease;
}

.channel-item.active .channel-name {
    font-weight: 700;
    letter-spacing: -0.005em;
}

/* Message Styling - Modern Design */
.chat-message {
    display: flex;
    padding: 1rem 1.25rem;
    margin: 0.125rem 0.5rem;
    border-radius: 12px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.chat-message:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    flex-shrink: 0;
    margin-right: 1.125rem;
    border: 2px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.chat-message:hover .message-avatar {
    transform: scale(1.02);
    border-color: rgba(255, 255, 255, 0.18);
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.375rem;
}

.message-username {
    font-weight: 600;
    color: #ffffff;
    font-size: 15px;
    font-family: 'Space Grotesk', sans-serif;
}

.message-timestamp {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
}

.message-text {
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    line-height: 1.6;
    word-wrap: break-word;
}

/* Input Bar - Modern Design */
.chat-input-container {
    position: sticky;
    bottom: 0;
    padding: 1.75rem 1.5rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    margin-top: auto;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
    z-index: 10;
    display: flex !important;
    flex-direction: column;
}

.chat-input-wrapper {
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 0.875rem 1.125rem;
    display: flex;
    align-items: flex-end;
    gap: 0.875rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chat-input-wrapper:focus-within {
    border-color: rgba(74, 222, 128, 0.6);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 0 0 3px rgba(74, 222, 128, 0.2),
        0 6px 20px rgba(74, 222, 128, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.chat-input {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    color: #ffffff;
    font-size: 15px;
    resize: none;
    flex: 1;
    min-height: 24px;
    max-height: 200px;
    line-height: 1.5;
}

.chat-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* Sidebar Styling */
.chat-sidebar-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    box-shadow: 0 1px 0 rgba(4, 4, 5, 0.2);
}

.chat-sidebar-header h3 {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.chat-user-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.chat-user-item {
    padding: 0.875rem 1.125rem;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.75);
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin: 0.125rem 0.25rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.chat-user-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95);
    transform: translateX(6px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Scrollbar Styling - Modern */
.channel-list-content::-webkit-scrollbar,
.chat-user-list::-webkit-scrollbar {
    width: 6px;
}

.channel-list-content::-webkit-scrollbar-track,
.chat-user-list::-webkit-scrollbar-track {
    background: transparent;
}

.channel-list-content::-webkit-scrollbar-thumb,
.chat-user-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.channel-list-content::-webkit-scrollbar-thumb:hover,
.chat-user-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
