/* Ekomon Chat Widget - Enhanced Design */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.chat-toggle {
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    border: none;
}

.chat-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

.chat-toggle-text {
    color: white;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
}

.chat-toggle.active {
    transform: scale(0.95);
}

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 700px;
    height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.chat-window.active {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.chat-header-content {
    flex: 1;
    text-align: center;
}

.chat-header h3 {
    font-size: 18px;
    margin-bottom: 5px;
    font-weight: 600;
}

.chat-header p {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
}

.chat-close {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    width: 32px;
    height: 32px;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

.message {
    margin-bottom: 15px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.bot {
    text-align: left;
}

.message.user {
    text-align: right;
}

.message-bubble {
    display: inline-block;
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
    line-height: 1.4;
}

.message.bot .message-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.message.user .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.quick-replies {
    padding: 15px 20px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-reply {
    background: #e9ecef;
    border: none;
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.quick-reply:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.chat-input {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    outline: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.chat-input input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.send-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.send-button:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.4);
}

.send-button svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.typing-indicator {
    display: none;
    padding: 10px 0;
}

.typing-dots {
    display: inline-flex;
    gap: 3px;
    padding: 8px 12px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #667eea;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

/* Budget Table Styles */
.budget-table {
    margin-top: 15px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-size: 13px;
    background: white;
}

.budget-table table {
    width: 100%;
    border-collapse: collapse;
}

.budget-table th,
.budget-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.budget-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    font-size: 12px;
}

.budget-table .total-row {
    background: #f8f9fa;
    font-weight: 600;
    border-top: 2px solid #667eea;
}

.budget-table .total-row td {
    color: #667eea;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chat-window {
        width: 90vw;
        height: 70vh;
        right: 5vw;
    }
    
    .chat-widget {
        right: 5vw;
    }
    
    .budget-table {
        font-size: 12px;
    }
    
    .budget-table th,
    .budget-table td {
        padding: 6px 8px;
    }
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}