/* Chatbot AI CSS - Green Clinic Spa */

/* Main Container */
#chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Toggle Button */
.chatbot-toggle {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #67C7C6 0%, #5AB5B4 100%);
    color: white;
    padding: 12px 16px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(103, 199, 198, 0.3);
    transition: all 0.3s ease;
    position: relative;
    min-width: 120px;
}

.chatbot-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(103, 199, 198, 0.4);
}

.chatbot-icon {
    margin-right: 8px;
    display: flex;
    align-items: center;
}

.chatbot-text {
    font-weight: 600;
    font-size: 14px;
}

.chatbot-notification {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Chatbot Widget */
.chatbot-widget {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: all 0.3s ease;
}

.chatbot-widget.active {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, #67C7C6 0%, #5AB5B4 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
}

.chatbot-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.chatbot-header-text h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chatbot-header-text span {
    font-size: 12px;
    opacity: 0.9;
}

.chatbot-controls {
    display: flex;
    gap: 8px;
}

.chatbot-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chatbot-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Content */
.chatbot-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Welcome Form */
.chatbot-welcome {
    padding: 24px;
    height: 100%;
    overflow-y: auto;
}

.chatbot-welcome-header {
    text-align: center;
    margin-bottom: 24px;
}

.chatbot-welcome-header h3 {
    color: #2c3e50;
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
}

.chatbot-welcome-header p {
    color: #7f8c8d;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.customer-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 6px;
}

.form-group input,
.form-group select {
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #67C7C6;
    box-shadow: 0 0 0 3px rgba(103, 199, 198, 0.1);
}

.form-group input::placeholder {
    color: #bdc3c7;
}

.btn-start-chat {
    background: linear-gradient(135deg, #67C7C6 0%, #5AB5B4 100%);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.btn-start-chat:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(103, 199, 198, 0.3);
}

.btn-start-chat:active {
    transform: translateY(0);
}

/* Messages */
.chatbot-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chatbot-messages-container {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.message.bot .message-avatar {
    background: linear-gradient(135deg, #67C7C6 0%, #5AB5B4 100%);
    color: white;
}

.message.user .message-avatar {
    background: #e1e8ed;
    color: #2c3e50;
}

.message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message.bot .message-content {
    background: #f8f9fa;
    color: #2c3e50;
    border-bottom-left-radius: 4px;
}

.message.user .message-content {
    background: linear-gradient(135deg, #67C7C6 0%, #5AB5B4 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 11px;
    color: #95a5a6;
    margin-top: 4px;
    text-align: right;
}

.message.user .message-time {
    text-align: left;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 0 20px 16px 20px;
    background: #f8f9fa;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    font-size: 14px;
    color: #7f8c8d;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #67C7C6;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Input */
.chatbot-input {
    border-top: 1px solid #e1e8ed;
    padding: 16px 20px;
    background: white;
}

.chatbot-input-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

#message-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

#message-input:focus {
    border-color: #67C7C6;
    box-shadow: 0 0 0 3px rgba(103, 199, 198, 0.1);
}

.send-button {
    background: linear-gradient(135deg, #67C7C6 0%, #5AB5B4 100%);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.send-button:hover {
    transform: scale(1.05);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.chatbot-input-footer {
    text-align: center;
    margin-top: 8px;
}

.chatbot-input-footer small {
    color: #95a5a6;
    font-size: 11px;
}

.chatbot-input-footer a {
    color: #67C7C6;
    text-decoration: none;
}

.chatbot-input-footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    #chatbot-container {
        bottom: 15px;
        right: 15px;
    }
    
    .chatbot-widget {
        width: calc(100vw - 30px);
        height: calc(100vh - 100px);
        right: -15px;
        bottom: 80px;
        border-radius: 12px 12px 0 0;
    }
    
    .chatbot-toggle {
        min-width: 100px;
        padding: 10px 14px;
    }
    
    .chatbot-text {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .chatbot-widget {
        width: 100vw;
        height: calc(100vh - 80px);
        right: -15px;
        bottom: 70px;
        border-radius: 0;
    }
    
    .chatbot-welcome {
        padding: 20px;
    }
    
    .chatbot-messages-container {
        padding: 16px;
    }
    
    .chatbot-input {
        padding: 12px 16px;
    }
}

/* Animation Classes */
.chatbot-widget.minimized {
    height: 60px;
}

.chatbot-widget.minimized .chatbot-content,
.chatbot-widget.minimized .chatbot-input {
    display: none;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Success/Error States */
.message.success .message-content {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.message.error .message-content {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.message.info .message-content {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}
