/**
 * Ezarly FAQ Chatbot Styles
 *
 * Classic, elegant design with sophisticated UI.
 */

:root {
    --ezarly-primary: #364151;
    --ezarly-secondary: #455565;
    --ezarly-accent: #2b3441;
    --ezarly-white: #ffffff;
    --ezarly-light-gray: #f8f9fa;
    --ezarly-gray: #e9ecef;
    --ezarly-dark-gray: #495057;
    --ezarly-text: #2d3436;
    --ezarly-shadow: rgba(54, 65, 81, 0.15);
    --ezarly-border-radius: 12px;
    --ezarly-font: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --ezarly-success: #28a745;
    --ezarly-warning: #ffc107;
    --ezarly-danger: #dc3545;
}

/* Container for the entire chatbot */
#ezarly-chatbot-container {
    font-family: var(--ezarly-font);
    font-size: 14px;
    line-height: 1.6;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    color: var(--ezarly-text);
}

/* Chat button */
#ezarly-chatbot-button {
    background: linear-gradient(135deg, var(--ezarly-secondary), var(--ezarly-primary));
    color: var(--ezarly-white);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(54, 65, 81, 0.25);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

#ezarly-chatbot-button:hover {
    box-shadow: 0 6px 24px rgba(54, 65, 81, 0.4);
    transform: translateY(-2px);
}

#ezarly-chatbot-button-icon {
    width: 28px;
    height: 28px;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
}

/* Chat window */
#ezarly-chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 100px);
    background-color: var(--ezarly-white);
    border-radius: var(--ezarly-border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

#ezarly-chatbot-window.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
}

/* Chat header */
#ezarly-chatbot-header {
    background: linear-gradient(135deg, var(--ezarly-secondary), var(--ezarly-primary));
    color: var(--ezarly-white);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 60px;
}

#ezarly-chatbot-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ezarly-chatbot-logo {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    flex-shrink: 0;
}

.ezarly-chatbot-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

#ezarly-chatbot-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--ezarly-white);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

#ezarly-chatbot-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Messages container */
#ezarly-chatbot-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background-color: var(--ezarly-light-gray);
    gap: 16px;
}

/* Message styles */
.ezarly-chatbot-message {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.6;
    position: relative;
    box-shadow: 0 2px 6px var(--ezarly-shadow);
    font-size: 14px;
}

.ezarly-chatbot-message.bot {
    background-color: var(--ezarly-white);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    color: var(--ezarly-text);
    border: 1px solid var(--ezarly-gray);
}

.ezarly-chatbot-message.user {
    background: linear-gradient(135deg, var(--ezarly-secondary), var(--ezarly-primary));
    color: var(--ezarly-white);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.ezarly-chatbot-message.agent {
    background-color: var(--ezarly-light-gray);
    border-left: 3px solid var(--ezarly-success);
}

.ezarly-chatbot-message.system {
    background-color: #f8f9fa;
    color: var(--ezarly-dark-gray);
    font-style: italic;
    border: 1px dashed var(--ezarly-gray);
    border-left: 3px solid var(--ezarly-warning);
}

/* Input area */
#ezarly-chatbot-input-container {
    display: flex;
    padding: 20px;
    background-color: var(--ezarly-white);
    border-top: 1px solid var(--ezarly-gray);
    gap: 12px;
    align-items: flex-end;
}

#ezarly-chatbot-input {
    flex: 1;
    border: 1px solid var(--ezarly-gray);
    border-radius: 24px;
    padding: 12px 20px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    font-family: var(--ezarly-font);
}

#ezarly-chatbot-input:focus {
    border-color: var(--ezarly-primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 43, 0.1);
}

#ezarly-chatbot-send {
    background: linear-gradient(135deg, var(--ezarly-secondary), var(--ezarly-primary));
    border: none;
    padding: 8px;
    cursor: pointer;
    color: white;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    transform: rotate(-45deg);
    box-shadow: 0 2px 8px rgba(54, 65, 81, 0.3);
    flex-shrink: 0;
}

#ezarly-chatbot-send svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

#ezarly-chatbot-send:hover {
    transform: rotate(-45deg) scale(1.05);
    box-shadow: 0 4px 12px rgba(54, 65, 81, 0.4);
}

#ezarly-chatbot-send:active {
    transform: rotate(-45deg) scale(0.95);
}

/* Links in messages */
.ezarly-chatbot-message a {
    color: inherit;
    text-decoration: underline;
    font-weight: 500;
    transition: all 0.2s ease;
}

.ezarly-chatbot-message.bot a {
    color: var(--ezarly-primary);
}

.ezarly-chatbot-message.bot a:hover {
    color: var(--ezarly-accent);
}



#ezarly-chatbot-office-hours {
    font-size: 12px;
    color: var(--ezarly-dark-gray);
    margin-top: 8px;
}

/* Status Indicators */
#ezarly-chatbot-status {
    font-size: 12px;
    margin-top: 4px;
    transition: all 0.3s ease;
}

#ezarly-chatbot-status.hidden {
    display: none;
}

#ezarly-chatbot-agent-status {
    display: inline-flex;
    align-items: center;
    color: var(--ezarly-white);
    opacity: 0.9;
}

#ezarly-chatbot-agent-status::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

#ezarly-chatbot-agent-status.online::before {
    background-color: var(--ezarly-success);
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

#ezarly-chatbot-agent-status.away::before {
    background-color: var(--ezarly-warning);
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.2);
}

#ezarly-chatbot-agent-status.connecting::before {
    background-color: var(--ezarly-warning);
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.2);
    animation: pulse 2s infinite;
}

#ezarly-chatbot-agent-status.offline::before {
    background-color: var(--ezarly-danger);
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

/* Typing Indicator */
#ezarly-chatbot-typing {
    padding: 0 24px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

#ezarly-chatbot-typing.hidden {
    display: none;
}

.ezarly-chatbot-typing {
    display: inline-flex;
    align-items: center;
    background-color: var(--ezarly-white);
    padding: 12px 20px;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 6px var(--ezarly-shadow);
    gap: 4px;
}

.ezarly-chatbot-typing-dot {
    width: 8px;
    height: 8px;
    background-color: var(--ezarly-gray);
    border-radius: 50%;
    animation: typing-animation 1.4s infinite;
    opacity: 0.6;
}

.ezarly-chatbot-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.ezarly-chatbot-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-animation {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.6;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive design */
@media (max-width: 480px) {
    #ezarly-chatbot-container {
        bottom: 20px;
        right: 20px;
        max-width: calc(100vw - 40px);
    }
    
    #ezarly-chatbot-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 100px);
        bottom: 0;
        right: 0;
        border-radius: 12px 12px 0 0;
        max-height: 500px;
    }
    
    #ezarly-chatbot-button {
        width: 50px;
        height: 50px;
        position: relative;
    }
    
    #ezarly-chatbot-button-icon {
        width: 24px;
        height: 24px;
    }
    
    #ezarly-chatbot-input-container {
        padding: 15px;
        align-items: center;
    }
    
    #ezarly-chatbot-send {
        width: 40px;
        height: 40px;
        margin-left: 8px;
    }
    
    #ezarly-chatbot-send svg {
        width: 20px;
        height: 20px;
    }
}

/* Additional mobile safety for very small screens */
@media (max-width: 360px) {
    #ezarly-chatbot-container {
        bottom: 15px;
        right: 15px;
        max-width: calc(100vw - 30px);
    }
    
    #ezarly-chatbot-window {
        width: calc(100vw - 30px);
        height: calc(100vh - 80px);
    }
    
    #ezarly-chatbot-button {
        width: 45px;
        height: 45px;
    }
} 