/*
   STABLE MESSAGE BAR COMPONENT.
   Integrated into Flex-Layout to prevent overlapping and sidebar issues.
*/

.chat-input-wrapper {
    background: white !important;
    display: flex !important;
    align-items: flex-end !important;
    gap: 12px !important;
    border-top: 1px solid #eee !important;
    width: auto !important;
    box-sizing: border-box !important;

    padding-left: 16px !important;
    padding-right: 16px !important;
    padding-top: 14px !important;
    padding-bottom: calc(14px + env(safe-area-inset-bottom)) !important;

    z-index: 50 !important;
    flex-shrink: 0 !important;
    position: relative !important;
}

#chat-form {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0px !important;
    min-width: 0 !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    overflow: hidden !important; 
    box-shadow: 0 2px 6px rgba(0,0,0,0.02) !important;
}

.editor-toolbar {
    display: flex;
    gap: 2px;
    padding: 6px 10px;
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    align-items: center;
    flex-wrap: wrap;
}

.editor-toolbar button, .editor-toolbar select {
    background: none;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #475569;
    transition: background 0.2s;
    height: 28px;
}

.editor-toolbar button:hover, .editor-toolbar select:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.editor-toolbar select {
    cursor: pointer;
    outline: none;
}

#message-input {
    flex: 1 !important;
    padding: 14px 16px !important;
    font-size: 16px !important;
    outline: none !important;
    background: #ffffff !important;
    min-width: 0 !important;
    min-height: 48px !important;
    max-height: 150px !important;
    overflow-y: auto !important;
    border: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
    caret-color: #0f172a !important;
}

#message-input[empty]:before {
    content: attr(data-placeholder);
    color: #9ca3af;
    pointer-events: none;
    display: block; /* For Firefox */
}

#message-input:empty:not(:focus):before {
    content: attr(data-placeholder);
    color: #9ca3af;
    pointer-events: none;
}


#send-btn, #attach-btn {
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 20px !important;
    flex-shrink: 0 !important;
    padding: 0 !important;
    border: none !important;
    cursor: pointer !important;
    transition: transform 0.1s, opacity 0.2s, background-color 0.2s, box-shadow 0.2s;
}

#send-btn:active, #attach-btn:active {
    transform: scale(0.95);
}

#send-btn { 
    background: var(--primary-color) !important; 
    color: white !important; 
    align-self: flex-end;
    margin: 6px;
}
#attach-btn { 
    position: absolute !important;
    bottom: calc(100% + 12px) !important;
    left: 16px !important;
    background: white !important; 
    color: #475569 !important; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
    border: 1px solid #e2e8f0 !important;
    z-index: 60 !important;
}

#attach-btn:hover {
    background: #f8fafc !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}

