.chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    max-width: calc(100% - 40px);
    /* width: 400px;  Rimosso - gestito inline */
    /* height: 600px; Rimosso - gestito inline */
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

/* ✅ STILE DRAG & DROP PER IMMAGINI */
.chat-container.drag-over {
    background: #e3f2fd !important;
    border: 3px dashed #2196F3 !important;
    box-shadow: 0 0 20px rgba(33, 150, 243, 0.3) !important;
}

.chat-header {
    padding: 20px;
    /* background: rimosso - ora gestito dinamicamente dal PHP */
    color: white;
    border-radius: 10px 10px 0 0;
    border-radius: 10px 10px 0 0;
    cursor: default;
    /* Default quando aperta */
    display: flex;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.info-chat,
.close-chat {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.info-chat:hover,
.close-chat:hover {
    opacity: 1;
}

/* Gestione icone chiusura/apertura */
.chat-container.chat-open .icon-close {
    display: block;
}

.chat-container.chat-open .icon-open {
    display: none !important;
}

.chat-container:not(.chat-open) .icon-close {
    display: none !important;
}

.chat-container:not(.chat-open) .info-chat {
    display: none !important;
}

.chat-container:not(.chat-open) .icon-open {
    display: block !important;
}

/* ✅ INFO OVERLAY */
.info-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255);
    z-index: 10000;
    display: flex;
    align-items: start;
    justify-content: center;
    border-radius: 6px;
    padding: 20px;
    padding-top: 35px;
    box-sizing: border-box;
}

.info-content {
    text-align: center;
    color: #333;
    position: relative;
    width: 100%;
    max-height: calc(100% - 40px);
    display: flex;
    flex-direction: column;
}

.close-info {
    position: absolute;
    top: -44px;
    right: -7px;
    font-size: 44px;
    cursor: pointer;
    color: #666;
}

.info-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: bold;
    flex-shrink: 0;
}

.info-container {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 100%;
    padding-right: 10px;
}

.info-container::-webkit-scrollbar {
    width: 6px;
}

.info-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.info-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.info-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.info-content p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: #555;
}

/* ✅ DESIGN SPECIFICI */
/* .design-classic .chat-header - rimosso per permettere colore dinamico */

/* ✅ DESIGN BUBBLE_AI: bottone circolare nero con testo AI */

.ai-bubble-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #000;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
    z-index: 99999;
}

.ai-bubble-button:hover {
    background: #222;
}

.design-bubble_ai.chat-container {
    position: fixed;
    bottom: 100px;
    right: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}

/* Nel design bubble_ai nascondi il pulsante di chiusura header */
.design-bubble_ai .close-chat {
       display: flex;
}

/* Stato aperto con animazione */
.design-bubble_ai.chat-container.open {
    opacity: 1;
    transform: translateY(0);
}

.design-kodee .kodee-button {
    background: #000 !important;
    color: white !important;
    border: none !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
    border-radius: 25px !important;
    padding: 16px 32px !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    min-width: 200px !important;
}

.design-kodee .kodee-button:hover {
    background: #333 !important;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.5) !important;
    transform: translateY(-2px) !important;
}

.design-kodee .kodee-button:active {
    transform: translateY(0px) !important;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.4) !important;
}

.design-kodee .chat-container {
    border: 2px solid #000 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important;
}

.design-kodee .chat-header-kodee {
    /* background: rimosso per permettere colore dinamico */
    color: white !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
}

.design-kodee .send-message {
    background: #000 !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.design-kodee .send-message:hover {
    background: #333 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

.design-kodee .minimize-chat {
    background: rgba(255, 255, 255, 0.2) !important;
    border-radius: 50% !important;
    width: 30px !important;
    height: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s ease !important;
}

.design-kodee .minimize-chat:hover {
    background: rgba(255, 255, 255, 0.3) !important;
}

/* ✅ DESIGN KODEE - HEADER SEMPLICE */
.chat-header-kodee {
    /* background: rimosso per permettere colore dinamico */
    color: white !important;
    padding: 20px !important;
    border-radius: 10px 10px 0 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.chat-header-kodee .chat-title {
    font-weight: bold !important;
    font-size: 18px !important;
    text-align: center !important;
}


.chat-title {
    font-weight: bold;
    font-size: 18px;
}

/* Rimosso .minimize-chat vecchio */

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f5f5f5;
}

/* ✅ LOADING SOTTO I MESSAGGI */
.chat-loading {
    margin-bottom: 10px;
    opacity: 0.9;
}

/* ✅ Animazione puntini per messaggio di elaborazione */
.chat-loading::after {
    content: '';
    display: inline-block;
    width: 1.2em;
    text-align: left;
    animation: ai-support-pro-dots 1.2s steps(3, end) infinite;
}

@keyframes ai-support-pro-dots {
    0% { content: ''; }
    33% { content: '.'; }
    66% { content: '..'; }
    100% { content: '...'; }
}

/* ✅ Stato visivo per controlli disabilitati */
.chat-container .send-message.disabled,
.chat-container .voice-btn.disabled,
.chat-container #upload-btn.disabled,
.chat-container input[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-message {
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 8px;
    max-width: 85%;
    word-wrap: break-word;
    font-size: 16px;
    line-height: 1.5;
}

.user-message {
    background: #e3f2fd;
    margin-left: auto;
}

.bot-message {
    background: #fff;
    position: relative;
    margin-bottom: 40px;
    padding: 15px;
    border-radius: 8px;
    max-width: 85%;
    word-wrap: break-word;
    font-size: 16px;
    line-height: 1.5;
}

.error-message {
    background: #ffebee;
    color: #c62828;
}

.chat-input {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 8px;
    align-items: center;
    min-height: 60px;
}

.chat-input input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
    font-size: 16px;
    min-width: 0;
}

.chat-input input:focus {
    border-color: #000;
}

/* ===== DISCLAIMER AI ===== */
.ai-disclaimer {
    padding: 8px 15px;
    text-align: center;
    font-size: 11px;
    color: #000;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    word-wrap: break-word;
    line-height: 1.4;
}

.ai-disclaimer strong {
    font-weight: 700;
    color: #000;
}

/* ===== PULSANTE INVIA ===== */
/* ===== PULSANTE INVIA (ICON) ===== */
.send-message {
    padding: 12px;
    background: #000;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.send-message:hover {
    background: #333;
}

/* ===== PULSANTE MICROFONO (Whisper 1) ===== */
.voice-btn {
    padding: 12px;
    background: #000;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 0;
    font-weight: 500;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.voice-btn::before {
    content: '';
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"/><path d="M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"/></svg>') no-repeat center;
    background-size: 20px 20px;
    width: 20px;
    height: 20px;
    display: inline-block;
}

.voice-btn:hover {
    background: #333;
}

.voice-btn.recording {
    background: #dc3545;
    animation: pulse 1.5s infinite;
}

/* ===== PULSANTE TTS (TTS-1) - POSIZIONAMENTO PERFETTO ===== */
.tts-btn-message {
    position: absolute;
    bottom: -30px;
    left: 15px;
    background: #000;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.tts-btn-message::before {
    content: '';
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z"/></svg>') no-repeat center;
    background-size: 18px 18px;
    width: 18px;
    height: 18px;
    display: inline-block;
}

.tts-btn-message:hover {
    background: #333;
}

/* ===== PULSANTE TTS CON STATO PLAYING/STOP ===== */
.tts-btn-message.playing {
    background: #dc3545 !important;
    animation: pulse 1.5s infinite;
}

.tts-btn-message.playing::before {
    content: '';
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z"/></svg>') no-repeat center;
    background-size: 18px 18px;
    width: 18px;
    height: 18px;
    display: inline-block;
}

/* ===== PULSANTI LIKE/DISLIKE ===== */
.like-btn-message,
.dislike-btn-message {
    position: absolute;
    bottom: -30px;
    background: #000;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.like-btn-message {
    left: 50px;
    /* Posizionato accanto al TTS */
}

.dislike-btn-message {
    left: 85px;
    /* Posizionato accanto al LIKE */
}

.like-btn-message::before {
    content: '';
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M1 21h4V9H1v12zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2z"/></svg>') no-repeat center;
    background-size: 18px 18px;
    width: 18px;
    height: 18px;
    display: inline-block;
}

.dislike-btn-message::before {
    content: '';
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v2c0 1.1.9 2 2 2h6.31l-.95 4.57-.03.32c0 .41.17.79.44 1.06L9.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2z"/></svg>') no-repeat center;
    background-size: 18px 18px;
    width: 18px;
    height: 18px;
    display: inline-block;
}

.like-btn-message:hover,
.dislike-btn-message:hover {
    background: #333;
}

/* ===== STATI ATTIVI LIKE/DISLIKE ===== */
.like-btn-message.active {
    background: #28a745 !important;
}

.dislike-btn-message.active {
    background: #dc3545 !important;
}

.like-btn-message.active::before {
    content: '';
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M1 21h4V9H1v12zm22-11c0-1.1-.9-2-2-2h-6.31l.95-4.57.03-.32c0-.41-.17-.79-.44-1.06L14.17 1 7.59 7.59C7.22 7.95 7 8.45 7 9v10c0 1.1.9 2 2 2h9c.83 0 1.54-.5 1.84-1.22l3.02-7.05c.09-.23.14-.47.14-.73v-2z"/></svg>') no-repeat center;
    background-size: 18px 18px;
    width: 18px;
    height: 18px;
    display: inline-block;
}

.dislike-btn-message.active::before {
    content: '';
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M15 3H6c-.83 0-1.54.5-1.84 1.22l-3.02 7.05c-.09.23-.14.47-.14.73v2c0 1.1.9 2 2 2h6.31l-.95 4.57-.03.32c0 .41.17.79.44 1.06L9.83 23l6.59-6.59c.36-.36.58-.86.58-1.41V5c0-1.1-.9-2-2-2z"/></svg>') no-repeat center;
    background-size: 18px 18px;
    width: 18px;
    height: 18px;
    display: inline-block;
}

/* ===== PULSANTE TTS GLOBALE ===== */
.tts-btn {
    padding: 12px;
    background: #000;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
    font-size: 0;
    font-weight: 500;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.tts-btn::before {
    content: '';
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02z"/></svg>') no-repeat center;
    background-size: 20px 20px;
    width: 20px;
    height: 20px;
    display: inline-block;
}

.tts-btn:hover {
    background: #333;
}

.tts-btn.playing {
    background: #28a745;
}

/* ===== ANIMAZIONI ===== */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* ===== STATI CHAT ===== */
.chat-container:not(.chat-open) {
    height: 70px !important;
    overflow: hidden;
}

.chat-container:not(.chat-open) .chat-messages,
.chat-container:not(.chat-open) .chat-input {
    display: none;
}

/* ===== COOKIE NOTICE ===== */
#cookie-notice {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 20px;
    text-align: center;
    z-index: 10000;
    font-size: 16px;
    line-height: 1.6;
}

#cookie-notice button {
    padding: 10px 25px;
    margin: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 480px) {
    .chat-container {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .chat-header {
        border-radius: 0;
    }

    .chat-container:not(.chat-open) {
        width: 350px;
        height: 70px;
        bottom: 20px;
        right: 20px;
        border-radius: 30px;
    }

    .chat-input {
        gap: 8px;
        padding: 15px;
    }

    .voice-btn,
    .tts-btn {
        width: 40px;
        height: 40px;
        padding: 10px;
    }

    .send-message {
        padding: 10px;
        font-size: 14px;
    }
}

/* ===== UPLOAD DOCUMENTI - STILI AGGIUNTI ===== */
.input-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.upload-btn-external {
    padding: 12px;
    background: #000;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.upload-btn-external:hover {
    background: #333;
}

.chat-input-field {
    width: 100%;
    padding: 12px 40px 12px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
    font-size: 16px;
}

.chat-input-field:focus {
    border-color: #000;
}

/* ===== MODAL ANTEPRIMA DOCUMENTO ===== */
.document-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.modal-close:hover {
    background: #f5f5f5;
    color: #000;
}

.modal-body {
    padding: 20px;
}

.document-preview {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.document-preview p {
    margin: 10px 0 0 0;
    color: #666;
    font-size: 14px;
}

.document-message label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.document-message textarea {
    width: 94%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
}

.document-message textarea:focus {
    outline: none;
    border-color: #000;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-cancel,
.btn-send {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-cancel {
    background: #f5f5f5;
    color: #666;
}

.btn-cancel:hover {
    background: #e5e5e5;
    color: #333;
}

.btn-send {
    background: #000;
    color: white;
}

.btn-send:hover {
    background: #333;
}

/* ===== RESPONSIVE MODAL ===== */
@media (max-width: 480px) {
    .modal-content {
        width: 95%;
        margin: 20px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 15px;
    }
}

/* ===== UPLOAD DOCUMENTI - STILI AGGIUNTI ===== */
.input-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

/* Rimosso upload-btn-integrated duplicato */

.chat-input-field {
    width: 100%;
    padding: 12px 40px 12px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
    font-size: 16px;
}

.chat-input-field:focus {
    border-color: #000;
}

/* ===== AREA DRAG & DROP ===== */
.drag-drop-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    border-radius: 10px;
}

.drag-drop-area.active {
    display: flex;
}

.drag-drop-area.drag-over {
    background: rgba(0, 0, 0, 0.9);
    border: 2px dashed #fff;
}

.drag-drop-content {
    text-align: center;
    color: white;
    padding: 20px;
}

.drag-drop-content svg {
    margin-bottom: 15px;
    opacity: 0.8;
}

.drag-drop-content p {
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
}

/* ===== MODAL ANTEPRIMA DOCUMENTO ===== */
.document-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.modal-close:hover {
    background: #f5f5f5;
    color: #000;
}

.modal-body {
    padding: 20px;
}

.document-preview {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.document-preview p {
    margin: 10px 0 0 0;
    color: #666;
    font-size: 14px;
}

.document-message label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.document-message textarea {
    width: 94%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
}

.document-message textarea:focus {
    outline: none;
    border-color: #000;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-cancel,
.btn-send {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-cancel {
    background: #f5f5f5;
    color: #666;
}

.btn-cancel:hover {
    background: #e5e5e5;
    color: #333;
}

.btn-send {
    background: #000;
    color: white;
}

.btn-send:hover {
    background: #333;
}

/* ===== RESPONSIVE MODAL ===== */
@media (max-width: 480px) {
    .modal-content {
        width: 95%;
        margin: 20px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 15px;
    }
}

/* ===== COMPACT MODE ===== */
.chat-container.compact-mode .chat-header {
    padding: 12px 15px;
}

.chat-container.compact-mode .chat-title {
    font-size: 14px;
}

.chat-container.compact-mode .header-controls svg {
    width: 18px;
    height: 18px;
}

.chat-container.compact-mode .send-message,
.chat-container.compact-mode .voice-btn,
.chat-container.compact-mode .upload-btn-external {
    width: 28px;
    height: 32px;
    padding: 4px;
}

.chat-container.compact-mode .send-message svg {
    width: 18px;
    height: 18px;
}

.chat-container.compact-mode .voice-btn::before {
    background-size: 16px 16px;
    width: 16px;
    height: 16px;
}

.chat-container.compact-mode .upload-btn-external svg {
    width: 16px;
    height: 16px;
}

.chat-container.compact-mode .input-container input {
    padding: 6px;
}

.chat-container.compact-mode .chat-input {
    padding: 15px;
    min-height: 50px;
    gap: 4px;
}

.chat-container.compact-mode .tts-btn-message,
.chat-container.compact-mode .like-btn-message,
.chat-container.compact-mode .dislike-btn-message {
    width: 28px;
    height: 28px;
}

/* ===== COMPACT MODE - CHAT CLOSED ===== */
.chat-container.compact-mode:not(.chat-open) {
    height: 50px !important;
}