/**
 * Fetchef Chatbot Styles
 * Professional luxury-oriented design
 * Colors: #0F5151 (Fetchef green), #88D499 (light green), #ef69e9 (flashy pink)
 */

/* CSS Variables for easy customization */
:root {
    --fetchef-primary-green: #0F5151;
    --fetchef-light-green: #88D499;
    --fetchef-flashy-pink: #ef69e9;
    --fetchef-white: #ffffff;
    --fetchef-light-gray: #f5f5f5;
    --fetchef-gray: #e0e0e0;
    --fetchef-dark-gray: #666666;
    --fetchef-text-color: #333333;
    --fetchef-shadow: 0 4px 20px rgba(15, 81, 81, 0.2);
    --fetchef-shadow-hover: 0 6px 30px rgba(15, 81, 81, 0.3);
}

/* Main Container */
#fetchef-chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Chat Toggle Button (visible when minimized) */
.fetchef-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--fetchef-primary-green) 0%, var(--fetchef-light-green) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--fetchef-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fetchef-chat-toggle:hover {
    box-shadow: var(--fetchef-shadow-hover);
    transform: scale(1.05);
}

.fetchef-chat-toggle:active {
    transform: scale(0.95);
}

/* Hide toggle button when chat is open */
.fetchef-chatbot-minimized .fetchef-chat-window {
    display: none;
}

.fetchef-chatbot-minimized .fetchef-chat-toggle {
    display: flex;
}

/* Show chat window and hide toggle when maximized */
#fetchef-chatbot-container:not(.fetchef-chatbot-minimized) .fetchef-chat-window {
    display: flex;
}

#fetchef-chatbot-container:not(.fetchef-chatbot-minimized) .fetchef-chat-toggle {
    display: none;
}

/* Chat Window */
.fetchef-chat-window {
    width: 380px;
    height: 600px;
    background: var(--fetchef-white);
    border-radius: 16px;
    box-shadow: var(--fetchef-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Chat Header */
.fetchef-chat-header {
    background: linear-gradient(135deg, var(--fetchef-primary-green) 0%, var(--fetchef-light-green) 100%);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--fetchef-white);
}

.fetchef-chat-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

/* User Photo */
.fetchef-user-photo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid var(--fetchef-white);
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* User Info */
.fetchef-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fetchef-user-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--fetchef-white);
}

.fetchef-user-status {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 6px;
}

.fetchef-user-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--fetchef-flashy-pink);
    display: inline-block;
    animation: pulse 2s infinite;
}

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

/* Minimize Button */
.fetchef-minimize-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    padding: 0;
}
.fetchef-minimize-btn-primary {
    border: none;
    border-radius: 8px;
    /* width: 32px; */
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    /* padding: 2px auto; */
    margin-right: 4px;
    font-size: 12px;
}

.fetchef-minimize-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.fetchef-minimize-btn:active {
    transform: scale(0.95);
}

/* Chat Messages Container */
.fetchef-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--fetchef-light-gray);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Custom Scrollbar */
.fetchef-chat-messages::-webkit-scrollbar {
    width: 6px;
}

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

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

.fetchef-chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--fetchef-dark-gray);
}

/* Message */
.fetchef-message {
    display: flex;
    animation: messageIn 0.3s ease-out;
}

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

/* Bot Message */
.fetchef-bot-message {
    justify-content: flex-start;
}

.fetchef-bot-message .fetchef-message-content {
    background: var(--fetchef-white);
    color: var(--fetchef-text-color);
    border-radius: 12px 12px 12px 4px;
}

/* User Message */
.fetchef-user-message {
    justify-content: flex-end;
}

.fetchef-user-message .fetchef-message-content {
    background: linear-gradient(135deg, var(--fetchef-primary-green) 0%, var(--fetchef-light-green) 100%);
    color: var(--fetchef-white);
    border-radius: 12px 12px 4px 12px;
}

/* Message Content */
.fetchef-message-content {
    max-width: 75%;
    padding: 12px 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.fetchef-message-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

/* Message Time */
.fetchef-message-time {
    display: block;
    font-size: 11px;
    margin-top: 6px;
    opacity: 0.7;
}

/* Loading Indicator */
.fetchef-loading-indicator {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background: var(--fetchef-light-gray);
}

.fetchef-typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: var(--fetchef-white);
    border-radius: 12px 12px 12px 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

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

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

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

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

/* Chat Input Container */
.fetchef-chat-input-container {
    padding: 16px 20px;
    background: var(--fetchef-white);
    border-top: 1px solid var(--fetchef-gray);
}

/* Chat Form */
.fetchef-chat-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Message Input */
.fetchef-message-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--fetchef-gray);
    border-radius: 24px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.fetchef-message-input:focus {
    border-color: var(--fetchef-primary-green);
}

.fetchef-message-input::placeholder {
    color: var(--fetchef-dark-gray);
}

/* Send Button */
.fetchef-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--fetchef-primary-green) 0%, var(--fetchef-light-green) 100%);
    color: var(--fetchef-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    box-shadow: 0 2px 8px rgba(15, 81, 81, 0.2);
}

.fetchef-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(15, 81, 81, 0.3);
}

.fetchef-send-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.fetchef-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--fetchef-gray);
}

/* Responsive Design for Mobile */
@media (max-width: 768px) {
    #fetchef-chatbot-container {
        bottom: 10px;
        right: 10px;
    }

    .fetchef-chat-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        max-width: 380px;
        max-height: 600px;
    }

    .fetchef-chat-toggle {
        width: 56px;
        height: 56px;
    }
}

@media (max-width: 480px) {
    .fetchef-chat-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 80px);
        border-radius: 12px;
    }

    .fetchef-chat-header {
        padding: 12px 16px;
    }

    .fetchef-user-photo {
        width: 40px;
        height: 40px;
    }

    .fetchef-user-name {
        font-size: 14px;
    }

    .fetchef-chat-messages {
        padding: 16px;
    }

    .fetchef-message-content {
        max-width: 80%;
        padding: 10px 14px;
    }

    .fetchef-message-content p {
        font-size: 13px;
    }

    .fetchef-chat-input-container {
        padding: 12px 16px;
    }

    .fetchef-message-input {
        padding: 10px 14px;
        font-size: 13px;
    }

    .fetchef-send-btn {
        width: 40px;
        height: 40px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    #fetchef-chatbot-container {
        display: none !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .fetchef-chat-window {
        border: 2px solid var(--fetchef-text-color);
    }

    .fetchef-message-content {
        border: 1px solid var(--fetchef-text-color);
    }
}
