/* ========================================
   BARRE DE FORMATAGE - KIKOOTCHAT
   ======================================== */

.message-toolbar {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95));
    border: 2px solid rgba(236, 72, 153, 0.3);
    border-radius: 10px 10px 0 0;
    border-bottom: none;
}

.toolbar-btn {
    width: 35px;
    height: 35px;
    border: 2px solid rgba(236, 72, 153, 0.3);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: #f472b6;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toolbar-btn:hover {
    background: rgba(236, 72, 153, 0.3);
    border-color: #ec4899;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(236, 72, 153, 0.4);
}

.toolbar-btn.active {
    background: linear-gradient(135deg, #ec4899, #be185d);
    border-color: #ec4899;
    color: white;
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.6);
}

.toolbar-separator {
    width: 2px;
    height: 30px;
    background: rgba(236, 72, 153, 0.2);
    margin: 0 5px;
}

.toolbar-color-picker {
    position: relative;
}

.toolbar-color-btn {
    width: 35px;
    height: 35px;
    border: 2px solid rgba(236, 72, 153, 0.3);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ef4444, #f59e0b, #10b981, #3b82f6, #8b5cf6);
    transition: all 0.3s;
}

.toolbar-color-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(236, 72, 153, 0.4);
}

.color-palette {
    position: absolute;
    bottom: 45px;
    left: 0;
    background: rgba(15, 23, 42, 0.98);
    border: 2px solid rgba(236, 72, 153, 0.5);
    border-radius: 10px;
    padding: 10px;
    display: none;
    grid-template-columns: repeat(6, 1fr);
    gap: 5px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.color-palette.show {
    display: grid;
    animation: slideUp 0.2s ease;
}

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

.color-option {
    width: 30px;
    height: 30px;
    border-radius: 5px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.color-option:hover {
    transform: scale(1.2);
    border-color: white;
}

.toolbar-file-input {
    display: none;
}

.toolbar-select {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(236, 72, 153, 0.3);
    border-radius: 8px;
    color: #f472b6;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 150px;
}

.toolbar-select:hover {
    border-color: #ec4899;
    background: rgba(236, 72, 153, 0.2);
}

.toolbar-select:focus {
    outline: none;
    border-color: #ec4899;
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.5);
}

/* Emoji Picker */
.emoji-picker {
    position: absolute;
    bottom: 55px;
    right: 80px;
    background: rgba(15, 23, 42, 0.98);
    border: 2px solid rgba(236, 72, 153, 0.5);
    border-radius: 15px;
    padding: 15px;
    display: none;
    max-width: 350px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.emoji-picker.show {
    display: block;
    animation: slideUp 0.2s ease;
}

.emoji-picker-header {
    color: #f472b6;
    font-weight: 600;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(236, 72, 153, 0.3);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
}

.emoji-item {
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
    text-align: center;
}

.emoji-item:hover {
    background: rgba(236, 72, 153, 0.3);
    transform: scale(1.3);
}

/* Image Preview */
.image-preview-container {
    position: relative;
    display: none;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(236, 72, 153, 0.3);
    border-radius: 10px;
    margin-bottom: 10px;
}

.image-preview-container.show {
    display: block;
}

.image-preview {
    max-width: 200px;
    max-height: 150px;
    border-radius: 8px;
    border: 2px solid rgba(236, 72, 153, 0.3);
}

.image-preview-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 30px;
    height: 30px;
    background: rgba(239, 68, 68, 0.9);
    border: 2px solid #ef4444;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.image-preview-remove:hover {
    background: #ef4444;
    transform: rotate(90deg);
}

/* Message Input avec formatage */
.message-input-formatted {
    min-height: 60px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(236, 72, 153, 0.3);
    border-radius: 0 0 10px 10px;
    color: white;
    font-size: 16px;
    resize: vertical;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message-input-formatted:focus {
    outline: none;
    border-color: #ec4899;
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.5);
}

/* Scrollbar personnalisée pour emoji picker */
.emoji-picker::-webkit-scrollbar {
    width: 8px;
}

.emoji-picker::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.emoji-picker::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ec4899, #9d174d);
    border-radius: 10px;
}

.emoji-picker::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #f472b6, #ec4899);
}

/* Responsive */
@media (max-width: 768px) {
    .message-toolbar {
        flex-wrap: wrap;
        gap: 3px;
        padding: 8px;
    }

    .toolbar-btn {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }

    .toolbar-select {
        min-width: 100%;
        margin-top: 5px;
    }

    .emoji-picker {
        right: 10px;
        max-width: 300px;
    }

    .emoji-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* ========================================
   TOOLBAR HTML KIKOOTCHAT
   ======================================== */
.kikoot-toolbar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 5px !important;
    padding: 10px !important;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.95)) !important;
    border: 2px solid rgba(236, 72, 153, 0.3) !important;
    border-radius: 10px 10px 0 0 !important;
    border-bottom: none !important;
}
.kikoot-tools-left {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
}
.kikoot-tools-right {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}
.kt-btn {
    width: 35px !important;
    height: 35px !important;
    border: 2px solid rgba(236, 72, 153, 0.3) !important;
    border-radius: 8px !important;
    background: rgba(0, 0, 0, 0.3) !important;
    color: #f472b6 !important;
    font-size: 16px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s !important;
}
.kt-btn:hover {
    background: rgba(236, 72, 153, 0.3) !important;
    border-color: #ec4899 !important;
}
.kt-btn.active {
    background: linear-gradient(135deg, #ec4899, #be185d) !important;
    border-color: #ec4899 !important;
    color: white !important;
}
.kikoot-send-btn {
    background: linear-gradient(135deg, #ec4899, #be185d) !important;
    border: none !important;
    color: white !important;
    padding: 8px 20px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-weight: bold !important;
    font-size: 14px !important;
}
.kikoot-send-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(236, 72, 153, 0.4) !important;
}
#kt-send-mode {
    background: rgba(0,0,0,0.3) !important;
    border: 2px solid rgba(236, 72, 153, 0.3) !important;
    color: white !important;
    padding: 6px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
}
