/*
 * E-cab AI Chatbot Stylesheet
 * Sleek, premium glassmorphism styling
 */

:root {
    --ecab-bot-primary: #0f172a;
    --ecab-bot-accent: #38bdf8;
    --ecab-bot-success: #10b981;
    --ecab-bot-bg-light: #f8fafc;
    --ecab-bot-text-main: #1e293b;
    --ecab-bot-text-muted: #64748b;
    --ecab-bot-border: rgba(226, 232, 240, 0.8);
    --ecab-bot-glass-bg: rgba(255, 255, 255, 0.85);
    --ecab-bot-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* Floating Launcher */
#ecab-chatbot-launcher {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ecab-bot-primary) 0%, #1e293b 100%);
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.3);
    cursor: pointer;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#ecab-chatbot-launcher:hover {
    transform: scale(1.08) translateY(-3px);
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.4);
}

#ecab-chatbot-launcher .ecab-launcher-icon {
    color: #ffffff;
    font-size: 24px;
    transition: transform 0.3s ease;
}

#ecab-chatbot-launcher:hover .ecab-launcher-icon {
    transform: rotate(10deg);
}

.ecab-launcher-badge-pulse {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--ecab-bot-success);
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: ecab-pulse 2s infinite;
}

@keyframes ecab-pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Chatbot Window */
#ecab-chatbot-window {
    position: fixed;
    bottom: 105px;
    right: 30px;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 140px);
    border-radius: 20px;
    background: var(--ecab-bot-glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--ecab-bot-border);
    box-shadow: var(--ecab-bot-shadow);
    z-index: 999999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    transform-origin: bottom right;
}

/* Slide in animation */
.ecab-chat-open {
    animation: ecab-slide-in 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

@keyframes ecab-slide-in {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Header Section */
.ecab-chatbot-header {
    background: linear-gradient(135deg, var(--ecab-bot-primary) 0%, #1e293b 100%);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #ffffff;
}

.ecab-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ecab-bot-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background-color: #ffffff;
}

.ecab-bot-info h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.2;
}

.ecab-bot-status {
    font-size: 11px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
}

.ecab-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--ecab-bot-success);
    display: inline-block;
}

#ecab-chatbot-close,
#ecab-chatbot-reset {
    cursor: pointer;
    font-size: 16px;
    color: #94a3b8;
    transition: color 0.2s ease;
}

#ecab-chatbot-close:hover,
#ecab-chatbot-reset:hover {
    color: #ffffff;
}

/* Body / Chat Area */
.ecab-chatbot-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ecab-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Message Bubbles */
.ecab-msg-row {
    display: flex;
    gap: 10px;
    max-width: 85%;
    margin-bottom: 2px;
}

.ecab-msg-row.ecab-bot-row {
    align-self: flex-start;
}

.ecab-msg-row.ecab-user-row {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ecab-msg-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.45;
    word-break: break-word;
}

.ecab-bot-row .ecab-msg-bubble {
    background-color: #f1f5f9;
    color: var(--ecab-bot-text-main);
    border-top-left-radius: 4px;
}

.ecab-user-row .ecab-msg-bubble {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border-top-right-radius: 4px;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

.ecab-msg-time {
    font-size: 10px;
    color: var(--ecab-bot-text-muted);
    margin-top: 4px;
    padding: 0 4px;
    align-self: flex-end;
}

.ecab-bot-row .ecab-msg-time {
    text-align: left;
}

.ecab-user-row .ecab-msg-time {
    text-align: right;
    align-self: flex-start;
}

/* Typing Indicator Animation */
.ecab-typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 15px;
    background-color: #f1f5f9;
    border-radius: 16px;
    border-top-left-radius: 4px;
    width: fit-content;
}

.ecab-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #64748b;
    animation: ecab-typing 1.4s infinite ease-in-out;
}

.ecab-typing-dot:nth-child(1) { animation-delay: 0s; }
.ecab-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.ecab-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes ecab-typing {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* Quick Action Buttons Panel */
.ecab-chatbot-actions {
    padding: 12px 20px;
    border-top: 1px solid var(--ecab-bot-border);
    background-color: rgba(248, 250, 252, 0.7);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ecab-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    text-align: center;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.ecab-action-btn span {
    font-size: 14px;
}

.ecab-btn-booking {
    background-color: var(--ecab-bot-primary);
    color: #ffffff !important;
}

.ecab-btn-booking:hover {
    background-color: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
}

.ecab-btn-quote {
    background-color: #ffffff;
    color: var(--ecab-bot-primary) !important;
    border: 1px solid #cbd5e1;
}

.ecab-btn-quote:hover {
    background-color: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.ecab-btn-whatsapp {
    background-color: #25d366;
    color: #ffffff !important;
}

.ecab-btn-whatsapp:hover {
    background-color: #20ba5a;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.25);
}

.ecab-btn-review {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff !important;
}

.ecab-btn-review:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.25);
}

.ecab-phone-row {
    display: flex;
    gap: 8px;
}

.ecab-phone-row .ecab-btn-phone {
    flex: 1;
    background-color: #3b82f6;
    color: #ffffff !important;
    font-size: 12px;
}

.ecab-phone-row .ecab-btn-phone:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.2);
}

/* Footer / Input Area */
.ecab-chatbot-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--ecab-bot-border);
    display: flex;
    gap: 10px;
    align-items: center;
    background-color: #ffffff;
}

#ecab-user-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 24px;
    font-size: 14px;
    color: var(--ecab-bot-text-main);
    outline: none;
    transition: all 0.2s ease;
    box-shadow: none !important;
}

#ecab-user-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15) !important;
}

#ecab-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #3b82f6;
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#ecab-send-btn:hover {
    background-color: #2563eb;
    transform: scale(1.05);
}

#ecab-send-btn span {
    font-size: 14px;
    margin-left: -2px; /* Center send plane icon */
}

/* Responsiveness for mobile screens */
@media (max-width: 480px) {
    #ecab-chatbot-window {
        right: 10px;
        bottom: 85px;
        width: calc(100vw - 20px);
        height: 500px;
        max-height: calc(100vh - 100px);
    }
    #ecab-chatbot-launcher {
        right: 15px;
        bottom: 15px;
        width: 54px;
        height: 54px;
    }
}

/* Inline Quote Form Styles */
.ecab-quote-form-bubble {
    background-color: #ffffff !important;
    border: 1px solid var(--ecab-bot-border);
    border-radius: 16px;
    border-top-left-radius: 4px;
    padding: 16px;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.ecab-quote-form-bubble h3 {
    margin: 0 0 14px 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--ecab-bot-primary);
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 8px;
}

.ecab-quote-form-group {
    margin-bottom: 12px;
    text-align: left;
}

.ecab-quote-form-group label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--ecab-bot-text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ecab-quote-form-group input,
.ecab-quote-form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13px;
    color: var(--ecab-bot-text-main);
    box-sizing: border-box;
    transition: all 0.2s ease;
    background-color: #f8fafc;
}

.ecab-quote-form-group input:focus,
.ecab-quote-form-group select:focus {
    border-color: #3b82f6;
    background-color: #ffffff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.ecab-quote-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Extra Stops Styles */
.ecab-quote-stops-container {
    margin-bottom: 10px;
}

.ecab-quote-stop-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.ecab-quote-stop-row input {
    flex: 1;
}

.ecab-quote-remove-stop {
    background-color: #fee2e2;
    color: #ef4444;
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
}

.ecab-quote-remove-stop:hover {
    background-color: #fca5a5;
}

.ecab-quote-add-stop {
    background-color: #f1f5f9;
    color: var(--ecab-bot-text-main);
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 12px;
}

.ecab-quote-add-stop:hover {
    background-color: #e2e8f0;
    border-color: #94a3b8;
}

/* Form Action Buttons */
.ecab-quote-submit {
    width: 100%;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgb(37 99 235 / 0.15);
}

.ecab-quote-submit:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 8px 12px -1px rgb(37 99 235 / 0.25);
}

.ecab-quote-submit:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.ecab-quote-message {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    margin-top: 10px;
    display: none;
    text-align: left;
}

.ecab-quote-message.success {
    display: block;
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.ecab-quote-message.error {
    display: block;
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Google Maps Places Autocomplete Autocomplete Dropdown Override */
.pac-container {
    z-index: 1000000000 !important;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    border: 1px solid #e2e8f0;
    font-family: inherit;
}

.pac-item {
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
}

.pac-item:hover {
    background-color: #f1f5f9;
}

/* Conversational Flow Custom Interactive Cards */
.ecab-quote-input-card {
    background-color: #ffffff !important;
    border: 1px solid var(--ecab-bot-border);
    border-radius: 16px;
    border-top-left-radius: 4px;
    padding: 16px;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ecab-quote-input-card label {
    font-size: 11px;
    font-weight: 600;
    color: var(--ecab-bot-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    margin: 0;
}

.ecab-quote-input-card input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13px;
    color: var(--ecab-bot-text-main);
    box-sizing: border-box;
    transition: all 0.2s ease;
    background-color: #f8fafc;
}

.ecab-quote-input-card input:focus {
    border-color: #3b82f6;
    background-color: #ffffff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.ecab-quote-inline-confirm-btn {
    width: 100%;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    margin-top: 4px;
}

.ecab-quote-inline-confirm-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
}

.ecab-quote-vehicles-card {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.ecab-quote-vehicle-btn {
    flex: 1 1 calc(50% - 4px);
    background-color: #ffffff;
    color: var(--ecab-bot-primary);
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.ecab-quote-vehicle-btn:hover {
    background-color: #f8fafc;
    border-color: #3b82f6;
    color: #3b82f6;
    transform: translateY(-1px);
}

.ecab-quote-input-card textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
    background-color: #f8fafc;
    min-height: 60px;
    color: var(--ecab-bot-text-main);
    transition: all 0.2s ease;
}

.ecab-quote-input-card textarea:focus {
    border-color: #3b82f6;
    background-color: #ffffff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}
