/* css/ai-story-generator.css */

.chat-container {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    height: 70vh; /* Adjust height as needed */
    overflow: hidden;
}

.chat-messages {
    flex-grow: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-message {
    padding: 0.8rem 1.2rem;
    border-radius: 18px;
    max-width: 75%;
    line-height: 1.5;
    word-wrap: break-word;
    animation: message-pop-in 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes message-pop-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.user-message {
    background-color: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}

.ai-message {
    background-color: #f1f0f0;
    color: var(--dark);
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    white-space: pre-line;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 1rem 1.2rem;
}

.typing-indicator .dot {
    width: 8px;
    height: 8px;
    background-color: #999;
    border-radius: 50%;
    animation: typing-bounce 1.2s infinite ease-in-out;
}
.typing-indicator .dot:nth-child(2) { animation-delay: -1.0s; }
.typing-indicator .dot:nth-child(3) { animation-delay: -0.8s; }

@keyframes typing-bounce {
    0%, 80%, 100% {
        transform: scale(0);
    } 40% {
        transform: scale(1.0);
    }
}


.chat-form {
    display: flex;
    padding: 1rem;
    border-top: 1px solid #e0e0e0;
    background-color: #f8f9fa;
}

#chat-input {
    flex-grow: 1;
    padding: 0.8rem 1rem;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 1rem;
    font-family: inherit;
    margin-right: 0.8rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#chat-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.2);
}

#send-btn {
    flex-shrink: 0;
    background-color: var(--primary);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

#send-btn:hover:not(:disabled) {
    background-color: #3367d6;
    transform: scale(1.1);
}

#send-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#send-btn i {
    transform: translateX(1px); /* Minor adjustment for visual centering */
}