/* Chatbot Styles - Matching Website Design */

:root {
    --chatbot-primary: #06b6d4;
    --chatbot-secondary: #3b82f6;
    --chatbot-dark: #0f172a;
    --chatbot-light: #f1f5f9;
    --chatbot-error: #ef4444;
    --chatbot-success: #10b981;
    --chatbot-text: #1e293b;
    --chatbot-border: #e2e8f0;
    --chatbot-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Chatbot Button */
.chatbot-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    min-width: 100px;
    height: auto;
    padding: 12px 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-secondary));
    border: none;
    cursor: pointer;
    box-shadow: var(--chatbot-shadow);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.chatbot-toggle-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.chatbot-toggle-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
}

.chatbot-toggle-text {
    color: white;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.chatbot-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

.chatbot-toggle svg {
    width: 30px;
    height: 30px;
    fill: white;
}

/* Chatbot Widget */
.chatbot-widget {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 140px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    animation: slideUp 0.3s ease;
    pointer-events: auto;
}

.chatbot-widget.active {
    display: flex;
}

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

/* Chatbot Header */
.chatbot-header {
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-secondary));
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 16px 16px 0 0;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.chatbot-header p {
    margin: 5px 0 0 0;
    font-size: 12px;
    opacity: 0.9;
}

.chatbot-close {
    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.2s;
    color: white;
    font-size: 20px;
    line-height: 1;
}

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

/* Chatbot Messages */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chatbot-message {
    display: flex;
    gap: 12px;
    max-width: 80%;
    animation: fadeIn 0.3s ease;
}

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

.chatbot-message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chatbot-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.chatbot-message.bot .chatbot-avatar {
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-secondary));
    color: white;
}

.chatbot-message.user .chatbot-avatar {
    background: var(--chatbot-dark);
    color: white;
}

.chatbot-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.chatbot-message.bot .chatbot-bubble {
    background: white;
    color: var(--chatbot-text);
    border: 1px solid var(--chatbot-border);
}

/* Markdown formatting in bot messages */
.chatbot-message.bot .chatbot-bubble strong {
    font-weight: 600;
    color: var(--chatbot-primary);
}

.chatbot-message.bot .chatbot-bubble em {
    font-style: italic;
}

.chatbot-message.bot .chatbot-bubble ul,
.chatbot-message.bot .chatbot-bubble ol {
    margin: 8px 0;
    padding-left: 20px;
}

.chatbot-message.bot .chatbot-bubble li {
    margin: 4px 0;
    list-style-position: outside;
}

.chatbot-message.bot .chatbot-bubble ul li {
    list-style-type: disc;
}

.chatbot-message.bot .chatbot-bubble ol li {
    list-style-type: decimal;
}

.chatbot-message.user .chatbot-bubble {
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-secondary));
    color: white;
}

/* Greeting Message */
.chatbot-greeting {
    background: var(--chatbot-light);
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 10px;
}

.chatbot-greeting h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: var(--chatbot-dark);
}

.chatbot-greeting p {
    margin: 0;
    font-size: 13px;
    color: var(--chatbot-text);
}

/* Chatbot Input */
.chatbot-input-area {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid var(--chatbot-border);
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chatbot-input-wrapper {
    flex: 1;
    position: relative;
}

.chatbot-input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 2px solid var(--chatbot-border);
    border-radius: 24px;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    transition: border-color 0.2s;
    font-family: inherit;
}

.chatbot-input:focus {
    outline: none;
    border-color: var(--chatbot-primary);
}

.chatbot-char-count {
    position: absolute;
    right: 12px;
    bottom: 12px;
    font-size: 11px;
    color: #94a3b8;
}

.chatbot-char-count.warning {
    color: var(--chatbot-error);
}

.chatbot-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-secondary));
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.chatbot-send-btn:hover:not(:disabled) {
    transform: scale(1.1);
}

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

.chatbot-send-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Typing Indicator */
.chatbot-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--chatbot-border);
    width: fit-content;
}

.chatbot-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--chatbot-primary);
    animation: typing 1.4s infinite;
}

.chatbot-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.chatbot-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Suggested Questions */
.chatbot-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 16px;
    margin: 12px 16px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 12px;
    border: 1px solid var(--chatbot-border);
}

.suggestions-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--chatbot-text);
    opacity: 0.7;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.suggestion-btn {
    background: white;
    border: 1px solid var(--chatbot-border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--chatbot-text);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.suggestion-btn:hover {
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-secondary));
    color: white;
    border-color: var(--chatbot-primary);
    transform: translateX(4px);
    box-shadow: 0 4px 6px rgba(6, 182, 212, 0.2);
}

.suggestion-btn:active {
    transform: translateX(2px);
}

/* Rating Section */
.chatbot-rating {
    padding: 16px 20px;
    background: var(--chatbot-light);
    border-top: 1px solid var(--chatbot-border);
    text-align: center;
}

.chatbot-rating h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--chatbot-dark);
}

.chatbot-stars {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.chatbot-star {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 28px;
    color: #cbd5e1;
    transition: all 0.2s;
    padding: 0;
}

.chatbot-star:hover,
.chatbot-star.active {
    color: #fbbf24;
    transform: scale(1.2);
}

/* Feedback Section */
.chatbot-feedback {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid var(--chatbot-border);
}

.chatbot-feedback h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--chatbot-dark);
}

.chatbot-feedback-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--chatbot-border);
    border-radius: 8px;
    font-size: 13px;
    resize: vertical;
    min-height: 60px;
    margin-bottom: 12px;
    font-family: inherit;
}

.chatbot-feedback-input:focus {
    outline: none;
    border-color: var(--chatbot-primary);
}

.chatbot-feedback-submit {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-secondary));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.chatbot-feedback-submit:hover {
    opacity: 0.9;
}

/* Email Capture Section */
.chatbot-email-capture {
    padding: 16px 20px;
    background: var(--chatbot-light);
    border-top: 1px solid var(--chatbot-border);
}

.chatbot-email-capture h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: var(--chatbot-dark);
}

.chatbot-email-capture p {
    margin: 0 0 12px 0;
    font-size: 12px;
    color: var(--chatbot-text);
}

.chatbot-email-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--chatbot-border);
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 12px;
}

.chatbot-email-input:focus {
    outline: none;
    border-color: var(--chatbot-primary);
}

.chatbot-email-submit {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, var(--chatbot-primary), var(--chatbot-secondary));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.chatbot-email-submit:hover {
    opacity: 0.9;
}

/* Escalation Banner */
.chatbot-escalation {
    background: #fef3c7;
    color: #92400e;
    padding: 12px 16px;
    font-size: 13px;
    text-align: center;
    border-radius: 8px;
    margin: 0 20px 16px 20px;
}

.chatbot-escalation a {
    color: #92400e;
    font-weight: 600;
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chatbot-widget {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: 90px;
        height: calc(100vh - 120px);
        max-height: calc(100vh - 120px);
    }
    
    .chatbot-toggle {
        bottom: 20px;
        right: 20px;
        z-index: 10000;
    }
}

/* Scrollbar Styling */
.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--chatbot-border);
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}
