/* === GENERAL RESET === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');

body {
    font-family: 'Inter', sans-serif;
    background-color: #000;
    margin: 0;
    padding: 0;
}

/* === Container principal === */
#dark-ai-enhanced-container {
    display: flex;
    flex-direction: column;
    height: auto;
    max-height: 80vh;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    padding: 20px;
    width: 100%;
    max-width: 420px;
    margin: auto;
    box-sizing: border-box;
}

/* === En-tête IA (logo + nom) === */
.shopform-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.shopform-logo {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    flex-shrink: 0;
    margin-right: 6px;
}

.shopform-header .title {
    font-size: 1.2em;
    font-weight: bold;
    color: #FFD700;
}

/* === Zone de chat === */
#chat-content {
    flex: 1;
    overflow-y: auto;
    max-height: 45vh;
    padding: 10px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: #f9f9f9;
    border-radius: 8px;
    scroll-behavior: smooth;
}

/* === Bulles de message === */
.history-entry {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.history-entry .prompt {
    align-self: flex-end;
    background-color: #222;
    color: #FFD700;
    padding: 10px 14px;
    border-radius: 18px 18px 2px 18px;
    max-width: 80%;
    font-size: 0.95em;
    font-weight: 500;
    word-wrap: break-word;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.history-entry .response {
    align-self: flex-start;
    background-color: #ffffff;
    color: #000;
    padding: 10px 14px;
    border-radius: 18px 18px 18px 2px;
    max-width: 90%;
    font-size: 0.95em;
    word-wrap: break-word;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* === Loader (IA tape...) === */
.typing-indicator {
    align-self: flex-start;
    background-color: #ffffff;
    color: #000;
    padding: 10px 14px;
    border-radius: 18px 18px 18px 2px;
    font-style: italic;
    font-size: 0.9em;
    max-width: 200px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%   { opacity: 0.4; }
    50%  { opacity: 1; }
    100% { opacity: 0.4; }
}

/* === Formulaire === */
form#promptFormEnhanced {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

form#promptFormEnhanced textarea {
    padding: 12px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 8px;
    resize: vertical;
    min-height: 60px;
    font-family: 'Inter', sans-serif;
}

form#promptFormEnhanced textarea::placeholder {
    color: #666;
    font-style: italic;
    font-size: 0.95em;
}

form#promptFormEnhanced textarea:focus {
    outline: none;
    border-color: #FFD700;
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.2);
}

form#promptFormEnhanced input[type="submit"] {
    background-color: #FFCC00;
    color: #000;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

form#promptFormEnhanced input[type="submit"]:hover {
    background-color: #d6ae00;
}

/* === Debug Console === */
.debug-panel {
    margin-top: 20px;
    border-top: 1px solid #ccc;
    padding-top: 10px;
}

.debug-toggle {
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border: none;
    cursor: pointer;
    border-radius: 4px;
}

.debug-console {
    margin-top: 10px;
    background-color: #222;
    color: #0f0;
    padding: 10px;
    border-radius: 4px;
    font-family: monospace;
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.9em;
}

.log-time {
    color: #ff0;
    margin-right: 5px;
}

/* === Bulle flottante === */
#chat-bubble-box {
    max-height: 80vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
    padding: 10px;
    box-sizing: border-box;
    border-radius: 12px;
}

.darkai-bubble {
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

/* === Responsive === */
@media (max-width: 768px) {
    #dark-ai-enhanced-container {
        padding: 12px;
    }

    .shopform-logo {
        width: 40px;
        height: 40px;
    }

    input[type="submit"] {
        width: 100%;
    }

    textarea {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .shopform-logo {
        width: 40px;
        height: 40px;
    }

    .shopform-header .title {
        font-size: 1em;
    }

    #chat-content {
        padding: 8px;
    }

    .history-entry .prompt,
    .history-entry .response {
        max-width: 100%;
    }
}
