/* ===== CHAT WIDGET STYLES ===== */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 12px;
    --box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Chat Widget Container */
.chat-widget {
    width: 100%;
    max-width: 400px;
    height: 600px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: var(--transition);
}

/* Chat Header */
.chat-header {
    background: var(--primary-color);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.company-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.status-text {
    font-size: 12px;
    opacity: 0.9;
}

.minimize-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: var(--transition);
}

.minimize-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.4;
    position: relative;
    animation: messageSlide 0.3s ease-out;
}

@keyframes messageSlide {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-message {
    background: var(--primary-color);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 6px;
}

.bot-message {
    background: white;
    border: 1px solid #e0e0e0;
    align-self: flex-start;
    border-bottom-left-radius: 6px;
}

.message-time {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 18px;
    align-self: flex-start;
    margin-bottom: 10px;
    max-width: 150px;
}

.typing-indicator.show {
    display: flex;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--secondary-color);
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Quick Reply Buttons */
.quick-replies {
    padding: 0 20px 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-reply-btn {
    background: white;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.quick-reply-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Chat Input Area */
.chat-input-area {
    border-top: 1px solid #e0e0e0;
    background: white;
    padding: 15px 20px;
}

.input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

#userInput {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 24px;
    outline: none;
    font-size: 14px;
    transition: var(--transition);
}

#userInput:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.send-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.send-btn:hover:not(:disabled) {
    background: #0056b3;
    transform: scale(1.05);
}

.send-btn:disabled {
    background: var(--secondary-color);
    cursor: not-allowed;
}

/* Chat Footer */
.chat-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--secondary-color);
}

.message-count {
    font-size: 11px;
}

.feedback-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition);
}

.feedback-btn:hover {
    background: #f8f9fa;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 24px;
    border-radius: var(--border-radius);
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.feedback-options {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.feedback-option {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: var(--transition);
}

.feedback-option:hover {
    background: #f8f9fa;
}

.feedback-option.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

#feedbackComment {
    width: 100%;
    height: 80px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: vertical;
    margin-bottom: 15px;
    font-family: inherit;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

#submitFeedback {
    background: var(--primary-color);
    color: white;
}

#cancelFeedback {
    background: var(--secondary-color);
    color: white;
}

/* Responsive Design */
@media (max-width: 480px) {
    .chat-widget {
        height: 100vh;
        max-width: none;
        border-radius: 0;
    }
    
    body {
        padding: 0;
        background: white;
    }
    
    .message {
        max-width: 90%;
    }
}