/* Enhanced Chat Widget Styles */
.chat-widget {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    font-family: 'Cairo', sans-serif;
}

.chat-toggle {
    background: linear-gradient(45deg, #ff6600, #ff8533);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 20px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 102, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.chat-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.chat-toggle:hover::before {
    left: 100%;
}

.chat-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(255, 102, 0, 0.4);
    background: linear-gradient(45deg, #ff8533, #ffaa66);
}

.chat-toggle i {
    font-size: 18px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.chat-container {
    position: absolute;
    bottom: 70px;
    left: 0;
    width: 420px;
    height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    display: none;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.chat-container.active {
    display: flex;
    animation: slideInUp 0.4s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chat-header {
    background: linear-gradient(45deg, #ff6600, #ff8533);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-header-info i {
    font-size: 20px;
}

.chat-header h4 {
    margin: 0;
    font-size: 16px;
}

.chat-status {
    font-size: 12px;
    opacity: 0.9;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-messages {
    flex: 1;
    padding: 20px 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    scrollbar-width: thin;
    scrollbar-color: #ff6600 #f0f0f0;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #ff6600, #ff8533);
    border-radius: 3px;
}

.message {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: fadeInMessage 0.3s ease-out;
}

.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.3s ease;
}

.bot-message .message-avatar {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    box-shadow: 0 2px 6px rgba(108, 117, 125, 0.3);
}

.user-message .message-avatar {
    background: linear-gradient(135deg, #ff6600, #ff8533);
    color: white;
    box-shadow: 0 2px 6px rgba(255, 102, 0, 0.3);
}

.message-content {
    max-width: 78%;
    word-wrap: break-word;
    position: relative;
    overflow: hidden;
}

.message-content p {
    padding: 14px 18px;
    border-radius: 20px;
    margin: 0 0 8px 0;
    line-height: 1.7;
    font-size: 14px;
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    letter-spacing: 0.2px;
    white-space: pre-line;
    word-break: break-word;
}

.bot-message .message-content p {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    color: #2c3e50;
    border: 1px solid #e9ecef;
    border-bottom-left-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.user-message .message-content p {
    background: linear-gradient(135deg, #ff6600, #ff7722);
    color: white;
    border-bottom-right-radius: 8px;
    box-shadow: 0 2px 8px rgba(255, 102, 0, 0.25);
}

.message-time {
    font-size: 11px;
    color: #8e9297;
    margin-left: 12px;
    font-weight: 300;
    opacity: 0.8;
}

.chat-input-container {
    border-top: 1px solid #eee;
    padding: 15px 20px;
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

#chatInput {
    flex: 1;
    border: 2px solid #e9ecef;
    border-radius: 25px;
    padding: 12px 15px;
    font-size: 14px;
    font-family: 'Cairo', sans-serif;
    outline: none;
    transition: border-color 0.3s ease;
}

#chatInput:focus {
    border-color: #ff6600;
}

.chat-send {
    background: linear-gradient(45deg, #ff6600, #ff8533);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.chat-send:hover {
    transform: scale(1.05);
}

.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.suggestion-btn {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 15px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
}

.suggestion-btn:hover {
    background: #ff6600;
    color: white;
    border-color: #ff6600;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 15px;
    margin: 0 0 5px 0;
}

.typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

@media (max-width: 768px) {
    .chat-container {
        width: 360px;
        height: 520px;
        bottom: 60px;
    }
    
    .chat-toggle {
        padding: 12px 15px;
        font-size: 13px;
    }
    
    .chat-widget {
        bottom: 15px;
        left: 15px;
    }
    
    .message-content p {
        font-size: 13px;
        padding: 12px 16px;
    }
    
    .message-content {
        max-width: 82%;
    }
}

/* Enhanced Typing Animation */
.typing-animation {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 18px;
    margin: 5px 0;
}

.typing-animation span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff6600;
    animation: typingBounce 1.4s infinite ease-in-out;
    box-shadow: 0 2px 5px rgba(255, 102, 0, 0.3);
}

.typing-animation span:nth-child(1) { animation-delay: 0s; }
.typing-animation span:nth-child(2) { animation-delay: 0.2s; }
.typing-animation span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { 
        transform: translateY(0) scale(1); 
        opacity: 0.7;
    }
    30% { 
        transform: translateY(-12px) scale(1.2); 
        opacity: 1;
    }
}

/* Enhanced Message Styles */
.message {
    animation: fadeInMessage 0.3s ease-out;
}

@keyframes fadeInMessage {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-content p {
    line-height: 1.6;
    word-wrap: break-word;
}

/* Enhanced Bot Messages */
.bot-message .message-content {
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border: 1px solid #e9ecef;
    position: relative;
    overflow: hidden;
}

.bot-message .message-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 102, 0, 0.1), transparent);
    transition: left 0.6s ease;
}

.bot-message:hover .message-content::before {
    left: 100%;
}

/* Enhanced User Messages */
.user-message .message-content {
    background: linear-gradient(135deg, #ff6600, #ff8533);
    color: white;
    position: relative;
    overflow: hidden;
}

.user-message .message-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.user-message:hover .message-content::before {
    left: 100%;
}

/* Message Avatar Enhancements */
.message-avatar {
    background: linear-gradient(135deg, #ff6600, #ff8533);
    box-shadow: 0 3px 10px rgba(255, 102, 0, 0.3);
    transition: all 0.3s ease;
}

.message-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(255, 102, 0, 0.4);
}

.bot-message .message-avatar {
    background: linear-gradient(135deg, #333, #555);
}

.bot-message .message-avatar:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Chat Input Enhancements */
.chat-input-wrapper input:focus {
    border-color: #ff6600;
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.1);
    transform: translateY(-1px);
}

.chat-send {
    background: linear-gradient(135deg, #ff6600, #ff8533);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.chat-send::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.4s ease;
}

.chat-send:hover::before {
    left: 100%;
}

.chat-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.4);
}

/* Suggestion Buttons Enhancement */
.suggestion-btn {
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border: 1px solid #e9ecef;
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cairo', sans-serif;
    position: relative;
    overflow: hidden;
}

.suggestion-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 102, 0, 0.1), transparent);
    transition: left 0.4s ease;
}

.suggestion-btn:hover::before {
    left: 100%;
}

.suggestion-btn:hover {
    background: linear-gradient(135deg, #ff6600, #ff8533);
    color: white;
    border-color: #ff6600;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}
