* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 50%, #0f1419 100%);
    min-height: 100vh;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0a0e27 0%, #1e3a8a 50%, #0f172a 100%);
}

.login-container {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 58, 138, 0.3) 100%);
    backdrop-filter: blur(20px);
    padding: 50px 40px;
    border-radius: 20px;
    box-shadow: 
        0 0 60px rgba(59, 130, 246, 0.3),
        0 20px 80px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 440px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h1 {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 50%, #93c5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.8em;
    margin-bottom: 10px;
    text-shadow: 0 0 30px rgba(59, 130, 246, 0.5);
}

.login-header p {
    color: #94a3b8;
    font-size: 1em;
    letter-spacing: 0.5px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #cbd5e1;
    font-weight: 500;
    font-size: 0.95em;
}

.form-group input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    font-size: 1em;
    color: #e2e8f0;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.form-group input::placeholder {
    color: #64748b;
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    width: 100%;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.6);
}

.btn-primary:active {
    transform: translateY(0);
}

.login-footer {
    margin-top: 35px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.9em;
}

.login-footer p {
    margin: 8px 0;
}

.alert {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 25px;
    border-left: 4px solid;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: #10b981;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-color: #ef4444;
}

.alert-info {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border-color: #3b82f6;
}

/* Chat Page */
.chat-page {
    padding: 0;
    margin: 0;
}

.chat-container {
    max-width: 100%;
    margin: 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 58, 138, 0.2) 100%);
    display: flex;
    flex-direction: column;
    height: 100vh;
    border: none;
}

.chat-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #1e293b 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo-link {
    text-decoration: none;
    transition: all 0.3s ease;
}

.logo-link:hover {
    transform: scale(1.05);
}

.header-left h1 {
    font-size: 1.8em;
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.user-badge {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(37, 99, 235, 0.3) 100%);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.95em;
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #93c5fd;
}

.btn-logout {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(220, 38, 38, 0.3) 100%);
    color: #fca5a5;
    padding: 10px 24px;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.btn-logout:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.5) 0%, rgba(220, 38, 38, 0.5) 100%);
    color: #fef2f2;
}

.btn-profile {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(37, 99, 235, 0.3) 100%);
    color: #93c5fd;
    padding: 10px 24px;
    border: 1px solid rgba(59, 130, 246, 0.4);
    margin-right: 10px;
}

.btn-profile:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.5) 0%, rgba(37, 99, 235, 0.5) 100%);
    color: #dbeafe;
}

.btn-messages {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.3) 0%, rgba(5, 150, 105, 0.3) 100%);
    color: #6ee7b7;
    padding: 10px 24px;
    border: 1px solid rgba(16, 185, 129, 0.4);
    margin-right: 10px;
}

.btn-messages:hover {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.5) 0%, rgba(5, 150, 105, 0.5) 100%);
    color: #d1fae5;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 50%, #0f1419 100%);
}

.message {
    margin-bottom: 20px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.6) 0%, rgba(30, 58, 138, 0.2) 100%);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: messageSlideIn 0.3s ease;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.message-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(59, 130, 246, 0.3);
}

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

.message-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    font-weight: 600;
    font-size: 1.1em;
}

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

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.message-own {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(37, 99, 235, 0.15) 100%);
    border-left: 4px solid #3b82f6;
    animation: messageSlideIn 0.3s ease;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.message-username {
    font-weight: 600;
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.message-timestamp {
    font-size: 0.85em;
    color: #64748b;
}

.message-content {
    color: #cbd5e1;
    line-height: 1.6;
    word-wrap: break-word;
}

.message-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-available {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.status-busy {
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
}

.status-away {
    background: #f59e0b;
    box-shadow: 0 0 8px #f59e0b;
}

.status-offline {
    background: #6b7280;
}

.chat-input {
    padding: 25px 30px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-top: 2px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

#message-form {
    display: flex;
    gap: 15px;
}

#message-input {
    flex: 1;
    padding: 14px 20px;
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    font-size: 1em;
    color: #e2e8f0;
    transition: all 0.3s ease;
}

#message-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

#message-input::placeholder {
    color: #64748b;
}

.btn-send {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 14px 35px;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

.btn-send:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(59, 130, 246, 0.6);
}

.btn-send:active {
    transform: translateY(0);
}

/* Status messages */
.status-message {
    text-align: center;
    color: #64748b;
    font-size: 0.9em;
    padding: 12px;
    font-style: italic;
    margin: 10px 0;
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 10px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 5px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

/* Responsive */
@media (max-width: 768px) {
    .chat-header {
        padding: 15px 20px;
    }
    
    .header-left h1 {
        font-size: 1.4em;
    }
    
    .chat-messages {
        padding: 20px 15px;
    }
    
    .chat-input {
        padding: 20px 15px;
    }
}

/* Chat layout with sidebar */
.chat-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.chat-sidebar {
    width: 260px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-right: 2px solid rgba(59, 130, 246, 0.3);
    display: flex;
    flex-direction: column;
}

.rooms-header {
    padding: 20px;
    border-bottom: 2px solid rgba(59, 130, 246, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rooms-header h3 {
    color: #cbd5e1;
    font-size: 1.1em;
    margin: 0;
}

.btn-create {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 8px;
    font-size: 1.5em;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-create:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: scale(1.05);
}

.rooms-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.room-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 5px;
    border-radius: 8px;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.2s ease;
    gap: 12px;
}

.room-item:hover {
    background: rgba(59, 130, 246, 0.15);
    color: #cbd5e1;
}

.room-item.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(37, 99, 235, 0.2) 100%);
    color: #60a5fa;
    border-left: 3px solid #3b82f6;
}

.room-icon {
    font-size: 1.2em;
    opacity: 0.7;
}

.room-name {
    font-weight: 500;
}

.chat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.room-header {
    padding: 20px 30px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.8) 0%, rgba(30, 58, 138, 0.3) 100%);
    border-bottom: 2px solid rgba(59, 130, 246, 0.2);
}

.room-header h2 {
    margin: 0;
    color: #60a5fa;
    font-size: 1.4em;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 58, 138, 0.3) 100%);
    backdrop-filter: blur(20px);
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 450px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.modal-header h3 {
    color: #cbd5e1;
    margin: 0;
    font-size: 1.3em;
}

.modal-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 2em;
    cursor: pointer;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Scrollbar for rooms list */
.rooms-list::-webkit-scrollbar {
    width: 6px;
}

.rooms-list::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
}

.rooms-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 3px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .chat-sidebar {
        width: 200px;
    }
    
    .room-header {
        padding: 15px 20px;
    }
    
    .room-header h2 {
        font-size: 1.2em;
    }
}

/* Profile Page */
.profile-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.profile-header {
    margin-bottom: 40px;
}

.profile-header h2 {
    color: #cbd5e1;
    font-size: 2em;
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.profile-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.profile-section {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.6) 0%, rgba(30, 58, 138, 0.2) 100%);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 15px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.profile-section h3 {
    color: #cbd5e1;
    margin-bottom: 20px;
    font-size: 1.3em;
}

/* Avatar Section */
.avatar-container {
    display: flex;
    align-items: center;
    gap: 30px;
}

.avatar-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(59, 130, 246, 0.4);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

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

.avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    font-size: 3em;
    font-weight: 600;
}

.avatar-upload {
    flex: 1;
}

.help-text {
    margin-top: 10px;
    color: #64748b;
    font-size: 0.9em;
}

/* Form Select */
.form-select {
    width: 100%;
    padding: 14px 18px;
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 10px;
    font-size: 1em;
    color: #e2e8f0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.form-select option {
    background: #0f172a;
    color: #e2e8f0;
}

/* Back button */
.btn-back {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(37, 99, 235, 0.3) 100%);
    color: #93c5fd;
    padding: 10px 24px;
    border: 1px solid rgba(59, 130, 246, 0.4);
    margin-right: 10px;
}

.btn-back:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.5) 0%, rgba(37, 99, 235, 0.5) 100%);
    color: #dbeafe;
}

/* Notification animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* Responsive profile */
@media (max-width: 768px) {
    .avatar-container {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-section {
        padding: 20px;
    }
}

/* User Profile Card */
.user-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 58, 138, 0.4) 100%);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
    position: relative;
}

.user-card-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 2em;
    cursor: pointer;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.user-card-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.user-card-avatar {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid rgba(59, 130, 246, 0.4);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.user-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.user-card-avatar img.show {
    display: block;
}

.user-card-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: none;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    font-size: 2.5em;
    font-weight: 600;
}

.user-card-avatar-placeholder.show {
    display: flex;
}

.user-card-info {
    text-align: center;
    margin-bottom: 25px;
}

.user-card-info h3 {
    color: #cbd5e1;
    font-size: 1.5em;
    margin-bottom: 10px;
}

.user-card-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.available {
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
}

.status-dot.busy {
    background: #ef4444;
    box-shadow: 0 0 10px #ef4444;
}

.status-dot.away {
    background: #f59e0b;
    box-shadow: 0 0 10px #f59e0b;
}

.status-dot.offline {
    background: #6b7280;
}

#card-status-text {
    color: #94a3b8;
    font-size: 0.95em;
}

.user-card-status-message {
    color: #64748b;
    font-style: italic;
    font-size: 0.9em;
    margin-top: 5px;
}

.user-card-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-card-actions .btn {
    width: 100%;
    justify-content: center;
}

/* Direct Messages */
.dm-sidebar {
    width: 280px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-right: 2px solid rgba(59, 130, 246, 0.3);
    display: flex;
    flex-direction: column;
}

.dm-header {
    padding: 20px;
    border-bottom: 2px solid rgba(59, 130, 246, 0.2);
}

.dm-header h3 {
    color: #cbd5e1;
    font-size: 1.1em;
    margin: 0;
}

.dm-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.dm-item {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 5px;
    border-radius: 10px;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.2s ease;
    gap: 12px;
    position: relative;
}

.dm-item:hover {
    background: rgba(59, 130, 246, 0.15);
    color: #cbd5e1;
}

.dm-item.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(37, 99, 235, 0.2) 100%);
    color: #60a5fa;
    border-left: 3px solid #3b82f6;
}

.dm-avatar {
    position: relative;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(59, 130, 246, 0.3);
    flex-shrink: 0;
}

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

.dm-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    font-weight: 600;
    font-size: 1.2em;
}

.status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #0f172a;
}

.status-indicator.status-available {
    background: #10b981;
}

.status-indicator.status-busy {
    background: #ef4444;
}

.status-indicator.status-away {
    background: #f59e0b;
}

.status-indicator.status-offline {
    background: #6b7280;
}

.dm-info {
    flex: 1;
    min-width: 0;
}

.dm-username {
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 3px;
}

.dm-time {
    font-size: 0.8em;
    color: #64748b;
}

.dm-unread-badge {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 600;
}

.dm-empty {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.dm-empty p {
    margin: 10px 0;
}

/* DM Content Area */
.dm-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f3a 50%, #0f1419 100%);
}

.dm-chat-header {
    padding: 20px 30px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.8) 0%, rgba(30, 58, 138, 0.3) 100%);
    border-bottom: 2px solid rgba(59, 130, 246, 0.2);
    display: flex;
    align-items: center;
    gap: 15px;
}

.dm-chat-avatar {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(59, 130, 246, 0.4);
}

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

.dm-chat-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    font-weight: 600;
    font-size: 1.3em;
}

.dm-chat-info h3 {
    color: #cbd5e1;
    margin: 0 0 5px 0;
    font-size: 1.2em;
}

.dm-status {
    color: #94a3b8;
    font-size: 0.9em;
}

.dm-messages {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.dm-message {
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: messageSlideIn 0.3s ease;
}

.dm-message-own {
    flex-direction: row-reverse;
}

.dm-message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(59, 130, 246, 0.3);
    flex-shrink: 0;
}

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

.dm-message-body {
    max-width: 60%;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.6) 0%, rgba(30, 58, 138, 0.2) 100%);
    backdrop-filter: blur(10px);
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.dm-message-own .dm-message-body {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3) 0%, rgba(37, 99, 235, 0.2) 100%);
    border-left: 3px solid #3b82f6;
}

.dm-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    gap: 10px;
}

.dm-message-username {
    font-weight: 600;
    color: #60a5fa;
    font-size: 0.9em;
}

.dm-message-timestamp {
    font-size: 0.75em;
    color: #64748b;
}

.dm-message-content {
    color: #cbd5e1;
    line-height: 1.5;
    word-wrap: break-word;
}

.dm-input {
    padding: 20px 30px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-top: 2px solid rgba(59, 130, 246, 0.3);
}

#dm-form {
    display: flex;
    gap: 15px;
}

#dm-input {
    flex: 1;
    padding: 14px 20px;
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    font-size: 1em;
    color: #e2e8f0;
    transition: all 0.3s ease;
}

#dm-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.dm-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #64748b;
}

.dm-placeholder-icon {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.dm-placeholder h3 {
    color: #94a3b8;
    margin-bottom: 10px;
}

/* Scrollbar for DM list */
.dm-list::-webkit-scrollbar {
    width: 6px;
}

.dm-list::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
}

.dm-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 3px;
}

/* Responsive DM */
@media (max-width: 768px) {
    .dm-sidebar {
        width: 220px;
    }
    
    .dm-message-body {
        max-width: 75%;
    }
}