/**
 * Fast Car Leads Chat Widget Styles
 */

/* Reset */
#fcl-chat-widget,
#fcl-chat-widget * {
    box-sizing: border-box !important;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Container - Force visibility */
#fcl-chat-widget {
    position: fixed !important;
    bottom: 20px !important;
    z-index: 999999 !important;
    font-size: 14px;
    line-height: 1.5;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    pointer-events: auto !important;
}

#fcl-chat-widget.position-bottom-right {
    right: 20px;
}

#fcl-chat-widget.position-bottom-left {
    left: 20px;
}

/* Chat Bubble */
.fcl-chat-bubble {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--fcl-color, #0066cc);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, box-shadow 0.2s;
}

.fcl-chat-bubble:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.fcl-chat-bubble svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.fcl-chat-bubble .fcl-close-icon {
    display: none;
}

#fcl-chat-widget.open .fcl-chat-bubble .fcl-chat-icon {
    display: none;
}

#fcl-chat-widget.open .fcl-chat-bubble .fcl-close-icon {
    display: block;
}

/* Chat Window */
.fcl-chat-window {
    position: absolute;
    bottom: 80px;
    width: 370px;
    height: 500px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

#fcl-chat-widget.position-bottom-right .fcl-chat-window {
    right: 0;
}

#fcl-chat-widget.position-bottom-left .fcl-chat-window {
    left: 0;
}

#fcl-chat-widget.open .fcl-chat-window {
    display: flex;
    animation: fcl-slide-up 0.3s ease;
}

@keyframes fcl-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.fcl-chat-header {
    background: var(--fcl-color, #0066cc);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.fcl-chat-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fcl-chat-avatar svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.fcl-chat-header-text h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.fcl-chat-header-text p {
    font-size: 12px;
    opacity: 0.9;
    margin: 2px 0 0 0;
}

/* Messages */
.fcl-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f7f7f7;
}

.fcl-message {
    max-width: 85%;
    margin-bottom: 12px;
    animation: fcl-fade-in 0.3s ease;
}

@keyframes fcl-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fcl-message-content {
    padding: 12px 16px;
    border-radius: 16px;
    word-wrap: break-word;
}

/* Assistant messages */
.fcl-message-assistant {
    margin-right: auto;
}

.fcl-message-assistant .fcl-message-content {
    background: white;
    border: 1px solid #e5e5e5;
    border-bottom-left-radius: 4px;
}

/* Visitor messages */
.fcl-message-visitor {
    margin-left: auto;
}

.fcl-message-visitor .fcl-message-content {
    background: var(--fcl-color, #0066cc);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Typing indicator */
.fcl-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.fcl-typing-dot {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: fcl-typing 1.4s infinite;
}

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

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

@keyframes fcl-typing {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-4px);
    }
}

/* Input */
.fcl-chat-input {
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e5e5e5;
    display: flex;
    gap: 10px;
    align-items: center;
}

.fcl-chat-input input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.fcl-chat-input input:focus {
    border-color: var(--fcl-color, #0066cc);
}

.fcl-chat-input input::placeholder {
    color: #999;
}

.fcl-chat-input button {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--fcl-color, #0066cc);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.fcl-chat-input button:hover {
    transform: scale(1.05);
}

.fcl-chat-input button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.fcl-chat-input button svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Powered by */
.fcl-powered-by {
    text-align: center;
    padding: 8px;
    font-size: 11px;
    color: #999;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
}

.fcl-powered-by a {
    color: #666;
    text-decoration: none;
}

.fcl-powered-by a:hover {
    text-decoration: underline;
}

/* Mobile */
@media (max-width: 480px) {
    #fcl-chat-widget {
        bottom: 10px;
    }
    
    #fcl-chat-widget.position-bottom-right {
        right: 10px;
    }
    
    #fcl-chat-widget.position-bottom-left {
        left: 10px;
    }
    
    .fcl-chat-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 100px);
        max-height: none;
        bottom: 70px;
    }
    
    #fcl-chat-widget.position-bottom-right .fcl-chat-window,
    #fcl-chat-widget.position-bottom-left .fcl-chat-window {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
    
    .fcl-chat-bubble {
        width: 54px;
        height: 54px;
    }
    
    .fcl-chat-bubble svg {
        width: 24px;
        height: 24px;
    }
}

/* Print - hide chat */
@media print {
    #fcl-chat-widget {
        display: none !important;
    }
}
