/* style.css */
:root {
    --bg-base: #121212;
    --bg-panel: #1e1e1e;
    --accent: #6366f1;
}

html, body { 
    height: 100%; margin: 0; padding: 0; 
    background-color: var(--bg-base) !important;
    color: #e0e0e0 !important; 
    overflow: hidden; 
}

.bg-base { background-color: var(--bg-base) !important; }
.bg-panel { background-color: var(--bg-panel) !important; }

.app-wrapper { 
    display: flex; flex-direction: column; height: 100dvh; 
}

header { border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important; }

/* Animazione fluida quando la chat si restringe o allarga */
.transition-layout {
    transition: width 0.3s ease-in-out;
}

#chat-container { 
    flex: 1; overflow-y: auto; padding: 24px 15px; 
    display: flex; flex-direction: column; gap: 18px;
}
#chat-container > div { max-width: 850px; width: 100%; margin: 0 auto; }

/* Wrapper input e tools */
.tools-container { max-width: 850px; margin: 0 auto; }
.custom-input-group { max-width: 850px; margin: 0 auto; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25); }

/* Bubbles */
.msg-bubble { 
    max-width: 75%; padding: 12px 18px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); font-size: 0.98rem; line-height: 1.5;
}
.msg-bubble.bg-primary { 
    background-color: var(--accent) !important; color: #ffffff !important; 
    border-radius: 1.3rem 1.3rem 0.2rem 1.3rem !important; 
}
.bg-assistant { 
    background-color: var(--bg-panel) !important; 
    border-radius: 1.3rem 1.3rem 1.3rem 0.2rem !important;
}

/* Scrollbar minimale */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: #3a3a3c; border-radius: 10px; }

/* Formattazione codice */
.msg-bubble pre { background-color: rgba(0,0,0,0.4); padding: 12px; border-radius: 8px; overflow-x: auto; margin-top: 10px; }
.msg-bubble code { color: #ff7b72; font-family: monospace; }
.msg-bubble pre code { color: #e0e0e0; }

.custom-input-group {
    max-width: 850px;
    margin: 0 auto;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
}

.custom-input-group button {
    flex-shrink: 0;
    width: 42px !important;
    height: 42px !important;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#user-input {
    flex-grow: 1;
    min-width: 0;
}