/* Custom Live Chat Widget */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: none;
    flex-direction: column;
}

.chat-widget.minimized {
    height: auto;
    display: block;
}

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

.chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-body {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    max-height: 350px;
}

.chat-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
}

.message.bot {
    background: #f1f3f5;
    color: #333;
    align-self: flex-start;
}

.message.user {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    align-self: flex-end;
}

.message.admin-reply {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    color: white;
    border-left: 4px solid #2e7d32;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

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

input.chat-input,
input[type="text"].chat-input,
.chat-input {
    flex: 1 !important;
    padding: 12px 15px !important;
    border: 1px solid #ddd !important;
    border-radius: 25px !important;
    outline: none !important;
    font-size: 14px !important;
    font-weight: normal !important;
    color: #333333 !important;
    background-color: #ffffff !important;
    background: #ffffff !important;
    background-image: none !important;
    text-shadow: none !important;
    -webkit-text-fill-color: #333333 !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    box-shadow: inset 0 0 0 50px #ffffff !important;
    -webkit-box-shadow: inset 0 0 0 50px #ffffff !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    line-height: 1.4 !important;
    text-indent: 0 !important;
    text-align: left !important;
    letter-spacing: normal !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Fix autofill styles */
input.chat-input:-webkit-autofill,
input.chat-input:-webkit-autofill:hover,
input.chat-input:-webkit-autofill:focus,
input.chat-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #ffffff inset !important;
    -webkit-text-fill-color: #333333 !important;
    color: #333333 !important;
    background-color: #ffffff !important;
    transition: background-color 5000s ease-in-out 0s !important;
}

input.chat-input::placeholder,
input.chat-input::-webkit-input-placeholder,
input.chat-input::-moz-placeholder,
input.chat-input:-ms-input-placeholder {
    color: #999999 !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #999999 !important;
    font-weight: normal !important;
}

input.chat-input:focus {
    border-color: #667eea !important;
    color: #333333 !important;
    background-color: #ffffff !important;
    -webkit-text-fill-color: #333333 !important;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2) !important;
}

.chat-send {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

.chat-send:hover {
    opacity: 0.9;
}

.chat-launcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chat-launcher:hover {
    transform: scale(1.1);
}

.chat-launcher.hidden {
    display: none;
}

.typing-indicator {
    display: none;
    padding: 10px 15px;
    background: #f1f3f5;
    border-radius: 18px;
    align-self: flex-start;
    max-width: 80px;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #999;
    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);
    }
}

@media (max-width: 768px) {
    .chat-widget {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    .chat-header {
        border-radius: 0;
    }
}