/* ===================================
   CHAT WIDGET STYLES
=================================== */

/* Chat Button */
.chat-widget-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #1A6B6B 0%, #2A8A8A 100%);
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(26, 107, 107, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: all 0.3s ease;
    border: none;
}

.chat-widget-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(26, 107, 107, 0.5);
}

.chat-widget-btn svg {
    width: 28px;
    height: 28px;
    color: white;
}

.chat-widget-btn .chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #D86050;
    border-radius: 50%;
    color: white;
    font-size: 12px;
    font-weight: bold;
    display: none;
    align-items: center;
    justify-content: center;
}

.chat-widget-btn .chat-badge.show {
    display: flex;
}

/* Chat Window */
.chat-widget-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 520px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 9998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
}

.chat-widget-window.open {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #1A6B6B 0%, #2A8A8A 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-header-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-header-avatar svg {
    width: 22px;
    height: 22px;
}

.chat-header-info {
    flex: 1;
}

.chat-header-title {
    font-weight: 600;
    font-size: 16px;
    margin: 0;
    color: #C96A52;
}

.chat-header-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-header-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #4AE04A;
    border-radius: 50%;
}

.chat-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

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

.chat-close-btn svg {
    width: 18px;
    height: 18px;
    color: white;
}

/* Email Form */
.chat-email-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
}

.chat-email-form.hidden {
    display: none;
}

.chat-email-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, rgba(26, 107, 107, 0.1) 0%, rgba(42, 138, 138, 0.1) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.chat-email-icon svg {
    width: 35px;
    height: 35px;
    color: #1A6B6B;
}

.chat-email-form h3 {
    color: #1A3B4D;
    font-size: 18px;
    margin: 0 0 8px 0;
}

.chat-email-form p {
    color: #6B7B8A;
    font-size: 14px;
    margin: 0 0 20px 0;
}

.chat-email-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #E5E8EB;
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.3s;
    margin-bottom: 12px;
}

.chat-email-input:focus {
    outline: none;
    border-color: #1A6B6B;
}

.chat-email-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #1A6B6B 0%, #2A8A8A 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.chat-email-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(26, 107, 107, 0.3);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: none;
    flex-direction: column;
    gap: 12px;
    background: #F8FAFB;
}

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

.chat-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    animation: messageIn 0.3s ease;
}

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

.chat-message.user {
    background: linear-gradient(135deg, #1A6B6B 0%, #2A8A8A 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-message.support {
    background: white;
    color: #1A3B4D;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chat-message .time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
    display: block;
}

.chat-message.support .time {
    color: #6B7B8A;
}

/* Welcome message */
.chat-welcome {
    text-align: center;
    padding: 20px;
    color: #6B7B8A;
    font-size: 13px;
}

/* Chat Input */
.chat-input-area {
    padding: 16px;
    background: white;
    border-top: 1px solid #E5E8EB;
    display: none;
}

.chat-input-area.active {
    display: block;
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #E5E8EB;
    border-radius: 24px;
    font-size: 14px;
    transition: border-color 0.3s;
    resize: none;
    max-height: 100px;
    min-height: 44px;
}

.chat-input:focus {
    outline: none;
    border-color: #1A6B6B;
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #1A6B6B 0%, #2A8A8A 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

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

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.chat-send-btn svg {
    width: 20px;
    height: 20px;
    color: white;
}

/* Typing indicator */
.chat-typing {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: white;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    max-width: 80px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chat-typing.show {
    display: flex;
}

.chat-typing span {
    width: 8px;
    height: 8px;
    background: #1A6B6B;
    border-radius: 50%;
    animation: typingDot 1.4s infinite ease-in-out;
}

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

@keyframes typingDot {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 480px) {
    .chat-widget-window {
        right: 10px;
        left: 10px;
        bottom: 80px;
        width: auto;
        height: calc(100vh - 150px);
        max-height: 500px;
    }
    
    .chat-widget-btn {
        right: 15px;
        bottom: 15px;
        width: 55px;
        height: 55px;
    }
}
