/* CSS pour les messages privés de la guilde */

/* Layout des DMs dans le chat */
.dm-layout {
    display: flex;
    flex: 1;
    min-height: 0;
    width: 100%;
    overflow: hidden;
}

/* Sidebar avec liste des membres */
.dm-sidebar {
    width: 250px;
    min-width: 250px;
    background: rgba(0, 0, 0, 0.3);
    border-right: 1px solid rgba(78, 205, 196, 0.2);
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Barre de recherche */
.dm-search-container {
    padding: 15px;
    border-bottom: 1px solid rgba(78, 205, 196, 0.2);
}

.dm-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(78, 205, 196, 0.3);
    color: #e0e0e0;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.dm-search-input:focus {
    outline: none;
    border-color: #4ecdc4;
    background: rgba(255, 255, 255, 0.08);
}

.dm-search-input::placeholder {
    color: #666;
}

/* Bouton flottant pour les DMs - SUPPRIMÉ (plus nécessaire) */
.dm-float-button {
    display: none !important;
}

/* Liste des membres */
.dm-members-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dm-members-list::-webkit-scrollbar {
    width: 6px;
}

.dm-members-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.dm-members-list::-webkit-scrollbar-thumb {
    background: rgba(78, 205, 196, 0.5);
    border-radius: 3px;
}

.dm-members-list::-webkit-scrollbar-thumb:hover {
    background: rgba(78, 205, 196, 0.7);
}

.dm-member-item {
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(78, 205, 196, 0.4);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    flex-shrink: 0;
    min-height: 60px;
}

.dm-member-item:hover {
    background: rgba(78, 205, 196, 0.15);
    transform: translateX(5px);
}

.dm-member-item.active {
    background: rgba(78, 205, 196, 0.25);
    border-left: 3px solid #4ecdc4;
}

.dm-member-item.has-unread {
    background: rgba(231, 76, 60, 0.1);
}

.dm-member-avatar {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #4ecdc4, #3ba89f);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

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

.dm-member-name {
    color: #e0e0e0;
    font-size: 0.9rem;
    font-weight: 600;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dm-member-preview {
    color: #888;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dm-unread-badge {
    background: rgba(78, 205, 196, 0.7);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
}

.dm-loading {
    text-align: center;
    color: #e0e0e0;
    padding: 20px;
    font-size: 0.9rem;
}

/* Zone de chat */
.dm-chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
    overflow: hidden;
}

.dm-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #666;
    padding: 40px;
    text-align: center;
}

.dm-placeholder-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.dm-placeholder p {
    font-size: 1rem;
    font-style: italic;
}

/* Chat actif */
.dm-active-chat {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.dm-chat-header {
    padding: 20px;
    border-bottom: 1px solid rgba(78, 205, 196, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
}

.dm-recipient-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.dm-recipient-name {
    color: #4ecdc4;
    font-size: 1.1rem;
    font-weight: 700;
}

.dm-recipient-status {
    color: #4ecdc4;
    font-size: 0.8rem;
}

.dm-back-btn {
    background: rgba(78, 205, 196, 0.2);
    border: 1px solid rgba(78, 205, 196, 0.3);
    color: #4ecdc4;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.dm-back-btn:hover {
    background: rgba(78, 205, 196, 0.3);
}

/* Messages */
.dm-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.dm-messages::-webkit-scrollbar {
    width: 8px;
}

.dm-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.dm-messages::-webkit-scrollbar-thumb {
    background: rgba(155, 89, 182, 0.5);
    border-radius: 4px;
}

.dm-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(155, 89, 182, 0.7);
}

.dm-messages-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #888;
}

.dm-message {
    display: flex;
    gap: 12px;
    animation: slideIn 0.3s ease;
}

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

.dm-message-avatar {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.dm-message.own-message .dm-message-avatar {
    background: linear-gradient(135deg, #4ecdc4, #44a3ff);
}

.dm-message-content-wrapper {
    max-width: 70%;
}

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

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

.dm-message-author {
    color: #9b59b6;
    font-size: 0.85rem;
    font-weight: 600;
}

.dm-message.own-message .dm-message-author {
    color: #4ecdc4;
}

.dm-message-time {
    color: #666;
    font-size: 0.75rem;
}

.dm-message-bubble {
    background: rgba(155, 89, 182, 0.2);
    border: 1px solid rgba(155, 89, 182, 0.3);
    padding: 12px 15px;
    border-radius: 12px 12px 12px 0;
    color: #e0e0e0;
    line-height: 1.5;
    word-wrap: break-word;
}

.dm-message.own-message .dm-message-bubble {
    background: rgba(78, 205, 196, 0.2);
    border-color: rgba(78, 205, 196, 0.3);
    border-radius: 12px 12px 0 12px;
}

.dm-message-image {
    margin-top: 8px;
    max-width: 100%;
    max-height: 250px;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
    display: block;
    background: rgba(0, 0, 0, 0.2);
}

.dm-message-image:hover {
    transform: scale(1.02);
}

/* Input */
.dm-image-preview {
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.2);
}

.dm-image-preview img {
    max-width: 200px;
    max-height: 150px;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    border: 2px solid rgba(155, 89, 182, 0.3);
}

.dm-input-container {
    padding: 12px 15px;
    border-top: 1px solid rgba(155, 89, 182, 0.2);
    background: rgba(0, 0, 0, 0.2);
}

.dm-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.dm-image-btn {
    background: rgba(155, 89, 182, 0.2);
    border: 2px solid rgba(155, 89, 182, 0.3);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    color: #9b59b6;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.dm-image-btn:hover {
    background: rgba(155, 89, 182, 0.3);
    border-color: #9b59b6;
}

.dm-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(155, 89, 182, 0.3);
    color: #e0e0e0;
    padding: 12px 15px;
    border-radius: 25px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.dm-input:focus {
    outline: none;
    border-color: #9b59b6;
    background: rgba(255, 255, 255, 0.08);
}

.dm-input::placeholder {
    color: #666;
}

.dm-send-btn {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    border: none;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.dm-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.5);
}

.dm-send-btn:active {
    transform: scale(0.95);
}

.dm-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

/* Responsive */
@media (max-width: 768px) {
    .dm-container {
        width: 100vw;
        height: 100vh;
        right: 0;
        border-radius: 0;
    }
    
    .dm-sidebar {
        width: 100%;
        max-width: 200px;
    }
    
    .dm-search-input {
        font-size: 0.8rem;
        padding: 8px;
    }
    
    .dm-member-item {
        padding: 10px 12px;
        min-height: 50px;
    }
    
    .dm-member-name {
        font-size: 0.85rem;
    }
    
    .dm-message-content-wrapper {
        max-width: 90%;
    }
    
    .dm-input {
        font-size: 0.85rem;
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .dm-layout {
        flex-direction: column;
    }
    
    .dm-sidebar {
        max-width: 100%;
        width: 100%;
        max-height: 30vh;
        border-right: none;
        border-bottom: 1px solid rgba(78, 205, 196, 0.2);
    }
}
