/* CSS pour le chat de la guilde */

/* Bouton flottant pour ouvrir le chat */
.chat-float-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #4ecdc4, #44a3ff);
    border-radius: 50%;
    border: none;
    box-shadow: 0 4px 20px rgba(78, 205, 196, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    transition: all 0.3s ease;
    z-index: 9998;
}

.chat-float-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 30px rgba(78, 205, 196, 0.7);
}

.chat-float-button.has-new-messages {
    animation: pulse 2s infinite;
}

.chat-float-button .chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: rgba(78, 205, 196, 0.9);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    border: 2px solid #1a1a2e;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(78, 205, 196, 0.5);
    }
    50% {
        box-shadow: 0 4px 30px rgba(78, 205, 196, 0.9);
    }
}

/* Container du chat */
.chat-container {
    position: fixed;
    bottom: 0;
    right: 30px;
    width: 550px;
    height: 550px;
    max-height: 80vh;
    background: linear-gradient(135deg, rgba(30, 30, 45, 0.98), rgba(20, 20, 35, 0.98));
    border-radius: 15px 15px 0 0;
    border: 2px solid rgba(78, 205, 196, 0.4);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
    display: none;
    flex-direction: column;
    z-index: 9999;
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.chat-container.open {
    display: flex;
    animation: slideInUp 0.3s ease-out;
}

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

/* En-tête du chat */
.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);
}

/* Onglets du chat */
.chat-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(78, 205, 196, 0.2);
    padding: 0 10px;
}

.chat-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #888;
    padding: 15px 20px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.chat-tab-btn:hover {
    color: #4ecdc4;
    background: rgba(78, 205, 196, 0.1);
}

.chat-tab-btn.active {
    color: #4ecdc4;
    border-bottom: 3px solid #4ecdc4;
}

.tab-badge {
    background: #e74c3c;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
}

.chat-tab-content {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.chat-tab-content.active {
    display: flex;
}

.chat-header {
    background: linear-gradient(135deg, #4ecdc4, #44a3ff);
    padding: 15px 20px;
    border-radius: 13px 13px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-title {
    color: white;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}

.chat-mode-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.chat-mode-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-mode-btn.private-mode {
    background: rgba(78, 205, 196, 0.6);
}

.chat-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Zone des messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 100px;
}

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

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(78, 205, 196, 0.5);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(78, 205, 196, 0.7);
}

/* Message individuel */
.chat-message {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid #4ecdc4;
    transition: all 0.3s ease;
    position: relative;
}

.chat-message:hover {
    background: rgba(78, 205, 196, 0.1);
    transform: translateX(3px);
}

.chat-message.own-message {
    border-left-color: #ff6b35;
    background: rgba(255, 107, 53, 0.1);
}

.chat-message.own-message:hover {
    background: rgba(255, 107, 53, 0.15);
}

.chat-message.reply-message {
    margin-left: 20px;
    border-left-color: #f39c12;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.message-author {
    font-weight: 700;
    color: #4ecdc4;
    font-size: 0.85rem;
}

.chat-message.own-message .message-author {
    color: #ff6b35;
}

.message-time {
    font-size: 0.7rem;
    color: #888;
}

.message-content {
    color: #e0e0e0;
    font-size: 0.88rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.message-image {
    max-width: 250px;
    max-height: 180px;
    border-radius: 6px;
    margin-top: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.message-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.message-private-badge {
    display: inline-block;
    background: rgba(78, 205, 196, 0.5);
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 8px;
}

.message-reply-to {
    background: rgba(255, 255, 255, 0.05);
    border-left: 2px solid #f39c12;
    padding: 8px 10px;
    margin-bottom: 8px;
    border-radius: 5px;
    font-size: 0.85rem;
}

.reply-to-author {
    color: #f39c12;
    font-weight: 600;
    margin-bottom: 3px;
}

.reply-to-content {
    color: #aaa;
    font-style: italic;
}

.message-actions {
    display: flex;
    gap: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chat-message:hover .message-actions {
    opacity: 1;
}

.action-btn {
    background: rgba(78, 205, 196, 0.2);
    border: none;
    color: #4ecdc4;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

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

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

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

.private-message-badge {
    background: rgba(243, 156, 18, 0.3);
    color: #f39c12;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 10px;
}

/* Sélection pour messages privés */
.chat-private-selector {
    padding: 15px;
    background: rgba(243, 156, 18, 0.1);
    border-bottom: 2px solid #f39c12;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-private-selector label {
    color: #f39c12;
    font-weight: 600;
    font-size: 0.9rem;
}

.chat-private-selector select {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(243, 156, 18, 0.4);
    border-radius: 8px;
    padding: 8px 12px;
    color: #fff;
    font-size: 0.9rem;
}

.cancel-private-btn {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid #e74c3c;
    color: #e74c3c;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.cancel-private-btn:hover {
    background: rgba(231, 76, 60, 0.3);
}

/* Zone de px;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chat-message:hover .message-actions {
    opacity: 1;
}

.message-action-btn {
    background: rgba(78, 205, 196, 0.2);
    border: 1px solid rgba(78, 205, 196, 0.4);
    color: #4ecdc4;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.message-action-btn:hover {
    background: rgba(78, 205, 196, 0.3);
    border-color: #4ecdc4;
}

/* Zone de réponse active */
.chat-replying-to {
    background: rgba(243, 156, 18, 0.1);
    border-left: 3px solid #f39c12;
    padding: 10px 15px;
    margin: 0 15px;
    border-radius: 5px;
    display: none;
}

.chat-replying-to.active {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.replying-to-text {
    flex: 1;
}

.replying-to-label {
    color: #f39c12;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 3px;
}

.replying-to-preview {
    color: #aaa;
    font-size: 0.85rem;
}

.cancel-reply-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #e74c3c;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.cancel-reply-btn:hover {
    background: rgba(231, 76, 60, 0.2);
}

/* Zone d'input */
.chat-input-container {
    padding: 12px 15px;
    border-top: 1px solid rgba(78, 205, 196, 0.2);
    background: rgba(0, 0, 0, 0.2);
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
}

.chat-image-btn {
    background: rgba(78, 205, 196, 0.2);
    border: 2px solid rgba(78, 205, 196, 0.3);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    color: #4ecdc4;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chat-image-btn:hover {
    background: rgba(78, 205, 196, 0.3);
    border-color: #4ecdc4;
}

.chat-image-preview {
    margin-top: 10px;
    position: relative;
    display: inline-block;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin-left: 10px;
}

.chat-image-preview img {
    max-width: 200px;
    max-height: 150px;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    border: 2px solid rgba(78, 205, 196, 0.3);
    display: block;
}

.remove-image-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(231, 76, 60, 0.9);
    border: none;
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.remove-image-btn:hover {
    background: #e74c3c;
    transform: scale(1.1);
}

.chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(78, 205, 196, 0.3);
    border-radius: 25px;
    padding: 12px 20px;
    color: #fff;
    font-size: 0.95rem;
    font-family: 'Exo 2', sans-serif;
    transition: all 0.3s ease;
}

.chat-input:focus {
    outline: none;
    border-color: #4ecdc4;
    background: rgba(78, 205, 196, 0.05);
    box-shadow: 0 0 15px rgba(78, 205, 196, 0.2);
}

.chat-input::placeholder {
    color: #888;
}

.chat-send-btn {
    background: linear-gradient(135deg, #4ecdc4, #44a3ff);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chat-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.4);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Message de chargement */
.chat-loading {
    text-align: center;
    padding: 20px;
    color: #4ecdc4;
    font-style: italic;
}

.chat-no-messages {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.chat-no-messages-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

.chat-no-messages-text {
    font-size: 1rem;
}

/* Responsive mobile */
@media (max-width: 768px) {
    .chat-container {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        right: 0;
        bottom: 0;
        border-radius: 0;
    }
    
    .chat-float-button {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 1.5rem;
    }
    
    .chat-header h3 {
        font-size: 1rem;
    }
    
    .chat-tabs {
        gap: 5px;
        padding: 8px;
    }
    
    .chat-tab-btn {
        font-size: 0.8rem;
        padding: 8px 12px;
    }
    
    .chat-messages {
        padding: 10px;
        gap: 6px;
    }
    
    .chat-message {
        padding: 6px 8px;
    }
    
    .message-author {
        font-size: 0.8rem;
    }
    
    .message-content {
        font-size: 0.85rem;
    }
    
    .message-image {
        max-width: 200px;
        max-height: 150px;
    }
    
    .chat-input {
        font-size: 0.85rem;
        padding: 8px;
    }
    
    .dm-layout {
        flex-direction: column;
    }
    
    .dm-sidebar {
        width: 100%;
        max-height: 30vh;
        border-right: none;
        border-bottom: 1px solid rgba(78, 205, 196, 0.2);
    }
}
