/* Chatbot Styles - Clean and Working */
.chatbox {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Chat Support Container */
.chatbox__support {
    position: fixed;
    bottom: 100px;
    right: 20px;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    width: 350px;
    height: 500px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

/* Show chat when active class is present */
.chatbox__support.chatbox--active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Chat Header */
.chatbox__header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    color: white;
    border-radius: 15px 15px 0 0;
}

.chatbox__image--header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.chatbox__image--header img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.chatbox__content--header h4 {
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
}

.chatbox__content--header p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.4;
}

.chatbox__content--header hr {
    border: none;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
    margin: 10px 0;
}

/* Chat Messages */
.chatbox__messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
}

.chatbox__messages::-webkit-scrollbar {
    width: 6px;
}

.chatbox__messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chatbox__messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chatbox__messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Message Items */
.messages__item {
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
    line-height: 1.4;
    position: relative;
    animation: fadeInUp 0.3s ease;
}

.messages__item--visitor {
    background: #e3f2fd;
    color: #1565c0;
    margin-left: auto;
    border-bottom-right-radius: 6px;
}

.messages__item--operator {
    background: #f3e5f5;
    color: #7b1fa2;
    margin-right: auto;
    border-bottom-left-radius: 6px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Quick Questions */
.quick-questions {
    padding: 15px 20px;
    background: #f0f2f5;
    border-top: 1px solid #e0e0e0;
}

.quick-question {
    display: block;
    width: 100%;
    padding: 10px 15px;
    margin-bottom: 8px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 20px;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-question:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Chat Footer */
.chatbox__footer {
    padding: 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chatbox__footer input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 25px;
    padding: 12px 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.chatbox__footer input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chatbox__footer input::placeholder {
    color: #999;
}

.send__button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.send__button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.send__button:active {
    transform: translateY(0);
}

/* Floating Chat Button */
.chatbox__button {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 9999;
}

.chatbox__button button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.chatbox__button button:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.chatbox__button button:active {
    transform: scale(0.95);
}

.chatbox__button button img {
    width: 30px;
    height: 30px;
    filter: brightness(0) invert(1);
    transition: transform 0.3s ease;
}

.chatbox__button button:hover img {
    transform: scale(1.1);
}

/* Pulse Animation for Button */
.chatbox__button button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Enhanced button states */
.chatbox__button button.chat-active {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .chatbox__support {
        width: 320px;
        height: 450px;
        bottom: 100px;
        right: 10px;
    }
    
    .chatbox__button {
        bottom: 80px;
        right: 20px;
    }
    
    .chatbox__button button {
        width: 55px;
        height: 55px;
    }
    
    .chatbox__button button img {
        width: 25px;
        height: 25px;
    }
}

@media (max-width: 480px) {
    .chatbox__support {
        width: 300px;
        height: 400px;
        bottom: 100px;
        right: 10px;
    }
    
    .chatbox__header {
        padding: 15px;
    }
    
    .chatbox__footer {
        padding: 15px;
    }
}

/* Hide chat when not active */
.chatbox__support:not(.chatbox--active) {
    pointer-events: none;
}
