/* Chat Widget Styles */
.chat-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.chat-widget-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c62828, #f7a400);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-widget-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.chat-widget-button.open {
    background: linear-gradient(135deg, #555, #333);
}

.chat-widget-modal {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 400px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9998;
    animation: slideUp 0.3s ease-out;
}

.chat-widget-modal.visible {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-widget-header {
    background: linear-gradient(135deg, #c62828, #f7a400);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-widget-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.chat-widget-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.chat-widget-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-widget-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f9f9f9;
}

.chat-input-section {
    padding: 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.chat-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.chat-tool-btn {
    background: white;
    border: 2px solid #e0e0e0;
    padding: 10px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #555;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.chat-tool-btn:hover {
    background: linear-gradient(135deg, #f5f5f5, #fafafa);
    border-color: #c62828;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.chat-tool-btn.active {
    background: linear-gradient(135deg, #c62828, #f7a400);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(198, 40, 40, 0.3);
}

.chat-input-group {
    display: flex;
    gap: 10px;
}

.chat-input-group textarea {
    flex: 1;
    min-height: 60px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    resize: none;
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: border-color 0.3s ease;
}

.chat-input-group textarea:focus {
    outline: none;
    border-color: #c62828;
    box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.1);
}

.chat-send-btn {
    background: linear-gradient(135deg, #c62828, #f7a400);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: opacity 0.3s ease;
    align-self: flex-end;
}

.chat-image-preview {
    max-width: 200px;
    max-height: 150px;
    border-radius: 8px;
    margin-top: 8px;
    border: 2px solid #e0e0e0;
}

.chat-image-container {
    position: relative;
    display: inline-block;
}

.chat-image-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #c62828;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

#imageInput {
    display: none;
}

.chat-send-btn:hover:not(:disabled) {
    opacity: 0.9;
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-message {
    margin-bottom: 15px;
    padding: 12px 15px;
    border-radius: 10px;
    max-width: 85%;
    word-wrap: break-word;
}

.chat-message.user {
    background: linear-gradient(135deg, #c62828, #f7a400);
    color: white;
    margin-left: auto;
    text-align: right;
}

.chat-message.assistant {
    background: white;
    color: #333;
    border: 1px solid #e0e0e0;
}

.chat-message.assistant ul {
    margin: 10px 0;
    padding-left: 20px;
}

.chat-message.assistant li {
    margin: 5px 0;
}

.chat-loading {
    display: flex;
    gap: 5px;
    padding: 12px 15px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    max-width: 85%;
    margin-bottom: 15px;
}


.chat-action-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.chat-action-btn {
    background: white;
    border: 1px solid #e0e0e0;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.chat-action-btn:hover {
    background: #f5f5f5;
    border-color: #c62828;
}
.chat-loading span {
    width: 8px;
    height: 8px;
    background: #c62828;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.chat-loading span:nth-child(1) {
    animation-delay: -0.32s;
}

.chat-loading span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.chat-category-badge {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #c62828, #f7a400);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .chat-widget-modal {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: 80px;
        height: calc(100vh - 100px);
    }
    
    .chat-widget-button {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}
