/* Live Chat Widget Styles */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
}

.chat-toggle {
    background: #3D3B85;
    color: white;
    padding: 15px 20px;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(61, 59, 133, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

.chat-toggle:hover {
    background: #2A2768;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(61, 59, 133, 0.4);
}

.chat-icon {
    font-size: 20px;
}

.chat-text {
    font-weight: 600;
    font-size: 14px;
}

.unread-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #FF6B35;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

.chat-window {
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin-bottom: 10px;
}

.chat-header {
    background: #3D3B85;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #8BC34A;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.chat-controls {
    display: flex;
    gap: 5px;
}

.control-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    font-size: 16px;
    line-height: 1;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

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

.message {
    margin-bottom: 15px;
}

.admin-message .message-content {
    background: white;
    padding: 12px 15px;
    border-radius: 15px 15px 15px 5px;
    max-width: 80%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
    border-left: 3px solid #FF6B35;
}

.message-sender {
    font-size: 0.8rem;
    font-weight: 600;
    color: #FF6B35;
    margin-bottom: 0.25rem;
}

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

.client-message .message-content {
    background: #3D3B85;
    color: white;
    padding: 12px 15px;
    border-radius: 15px 15px 5px 15px;
    max-width: 80%;
    display: inline-block;
    box-shadow: 0 2px 5px rgba(61, 59, 133, 0.2);
}

.message-time {
    font-size: 11px;
    color: #666;
    margin-top: 5px;
}

.chat-input-container {
    border-top: 1px solid #e0e6ed;
    background: white;
}

.user-info-form {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-info-form input {
    padding: 12px 15px;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    font-size: 14px;
    color: #2D3748;
    background: #ffffff;
}

.user-info-form input:focus {
    outline: none;
    border-color: #3D3B85;
}

.start-chat-btn {
    background: #FF6B35;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.start-chat-btn:hover {
    background: #FF8A65;
}

.chat-input-form {
    padding: 15px 20px;
    width: 100%;
    box-sizing: border-box;
}

.chat-input-form[style*="display: block"] {
    display: block !important;
    visibility: visible !important;
}

.input-group {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.input-group textarea {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e0e6ed;
    border-radius: 20px;
    resize: none;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.4;
    color: #2D3748 !important;
    background: #ffffff !important;
    min-height: 40px;
    width: 100%;
    box-sizing: border-box;
    outline: none;
}

#message-input {
    display: block !important;
    visibility: visible !important;
}

.input-group textarea:focus {
    outline: none;
    border-color: #3D3B85;
}

.input-group textarea::placeholder {
    color: #A0AEC0;
}

.send-btn {
    background: #FF6B35;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.send-btn:hover {
    background: #FF8A65;
    transform: scale(1.05);
}

.send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.send-icon {
    font-size: 16px;
}

.welcome-message {
    margin-bottom: 20px;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 10px 15px;
    background: white;
    border-radius: 15px 15px 15px 5px;
    max-width: 80px;
    margin-bottom: 15px;
}

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

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

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

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

@media (max-width: 480px) {
    .chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 100px);
        position: fixed;
        bottom: 80px;
        right: 20px;
    }
    
    .chat-toggle {
        padding: 12px 15px;
    }
    
    .chat-text {
        display: none;
    }
}
