/* Nippip AI Chat Styles */

.nippip-chat-section {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 2rem;
}

.nippip-chat-container {
    background: #f5f7e9;
    border: 1px solid #5A8C5B;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.nippip-chat-container.minimized {
    height: 60px;
    overflow: hidden;
}

.chat-header {
    background: #F5F7E9;
    border-bottom: 1px solid #5A8C5B;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h2 {
    color: #5A8C5B;
    font-family: 'Patrick Hand', cursive;
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-controls {
    display: flex;
    gap: 0.5rem;
}

.chat-controls button {
    background: transparent;
    border: 1px solid #5A8C5B;
    color: #5A8C5B;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.chat-controls button:hover {
    background: #5A8C5B;
    color: #F5F7E9;
    transform: translateY(-2px);
}

.chat-controls button:active {
    transform: translateY(0);
}

.chat-messages {
    height: 600px;
    overflow-y: auto;
    padding: 1.5rem;
    background: #F5F7E9;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-message {
    display: flex;
    gap: 0.75rem;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: #5A8C5B;
}

.ai-message .message-avatar {
    background: #F5F7E9;
    border: 2px solid #5A8C5B;
}

.message-content {
    flex: 1;
    background: transparent;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    border: 1px solid #5A8C5B;
    color: #000000;
    line-height: 1.6;
    font-family: 'Inter', sans-serif;
}

.user-message .message-content {
    background: transparent;
    border-color: #5A8C5B;
}

.ai-message .message-content {
    background: transparent;
}

.error-message .message-content {
    background: transparent;
    border-color: #ff4444;
    color: #ff8888;
}

.typing-indicator .typing-dots {
    display: flex;
    gap: 4px;
    padding: 0.75rem 1rem;
    background: transparent;
    border-radius: 4px;
    border: 1px solid #5A8C5B;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #5A8C5B;
    animation: typingDot 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    30% {
        opacity: 1;
        transform: scale(1);
    }
}

.chat-input-container {
    padding: 1rem 1.5rem;
    background: #F5F7E9;
    border-top: 1px solid #5A8C5B;
    display: flex;
    gap: 0.75rem;
}

#user-input {
    flex: 1;
    background: #F5F7E9;
    border: 1px solid #5A8C5B;
    border-radius: 4px;
    padding: 0.75rem 1rem;
    color: #000000;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    transition: border-color 0.2s ease;
}

#user-input:focus {
    outline: none;
    border-color: #5A8C5B;
}

#user-input::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

#send-button {
    background: #5A8C5B;
    border: none;
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

#send-button:hover:not(:disabled) {
    transform: translateY(-2px);
}

#send-button:active:not(:disabled) {
    transform: translateY(0);
}

#send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Scrollbar for chat messages */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #000000;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #5A8C5B;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #FFC700;
}

/* Responsive design */
@media (max-width: 768px) {
    .nippip-chat-section {
        margin: 2rem auto;
        padding: 0 1rem;
    }
    
    .chat-header h2 {
        font-size: 1.25rem;
    }
    
    .chat-controls button {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .chat-messages {
        height: 300px;
        padding: 1rem;
    }
    
    .chat-input-container {
        padding: 0.75rem 1rem;
    }
    
    #send-button {
        padding: 0.75rem 1rem;
    }
}

/* Message content formatting */
.message-content strong {
    color: #5A8C5B;
    font-weight: 600;
}

.message-content em {
    color: #ffffff;
    font-style: italic;
}

.message-content a {
    color: #5A8C5B;
    text-decoration: underline;
}

.message-content a:hover {
    color: #FFC700;
}
