/* Premium Chatbot Styles */

:root {
    --cb-primary: #0077b6; /* Premium Healthcare Blue */
    --cb-primary-hover: #005f92;
    --cb-primary-light: #e0f2fe;
    --cb-secondary: #f3f4f6;
    --cb-secondary-hover: #e5e7eb;
    --cb-text: #1f2937;
    --cb-text-light: #ffffff;
    --cb-text-muted: #6b7280;
    --cb-bg: #ffffff;
    --cb-app-bg: #f9fafb;
    --cb-border: #e5e7eb;
    --cb-shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --cb-shadow-lg: 0 12px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
    --cb-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --cb-error: #ef4444;
    --cb-success: #10b981;
}

/* Base Container */
#motionis-chatbot {
    position: fixed;
    bottom: 24px;
    right: 24px;
    top: auto !important;
    left: auto !important;
    z-index: 9999;
    font-family: var(--cb-font);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Launcher Container */
.cb-launcher-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Chat Icon Launcher */
#motionis-chatbot-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cb-primary), #0096c7);
    color: var(--cb-text-light);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: var(--cb-shadow-lg);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    border: none;
    outline: none;
}
#motionis-chatbot-icon:hover,
#motionis-chatbot-icon:focus-visible {
    transform: scale(1.05);
    box-shadow: 0 16px 48px rgba(0,0,0,0.15), 0 4px 16px rgba(0,0,0,0.08);
}
#motionis-chatbot-icon:active {
    transform: scale(0.95);
}

/* Bounce Animation */
@keyframes cbBounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-16px);}
    60% {transform: translateY(-8px);}
}
.bounce {
    animation: cbBounce 1.2s ease;
}

/* Notification Badge */
#motionis-chatbot-notification {
    background-color: var(--cb-bg);
    padding: 12px 16px;
    border-radius: 16px;
    box-shadow: var(--cb-shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--cb-border);
    position: relative;
}
#motionis-chatbot-notification::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background-color: var(--cb-bg);
    border-right: 1px solid var(--cb-border);
    border-top: 1px solid var(--cb-border);
}
#motionis-chatbot-notification.hidden {
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
}
.cb-notif-content {
    display: flex;
    flex-direction: column;
    font-size: 14px;
    line-height: 1.4;
}
.cb-notif-content strong {
    color: var(--cb-text);
    font-weight: 600;
}
.cb-notif-content span {
    color: var(--cb-text-muted);
}
.cb-notif-close {
    background: none;
    border: none;
    color: var(--cb-text-muted);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
}
.cb-notif-close:hover {
    background-color: var(--cb-secondary);
    color: var(--cb-text);
}

/* Chat Window */
#motionis-chatbot-window {
    width: 380px;
    height: min(720px, 80vh);
    background-color: var(--cb-app-bg);
    border-radius: 24px;
    box-shadow: var(--cb-shadow-lg);
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.165, 0.84, 0.44, 1);
    transform-origin: bottom right;
    transform: scale(0.95) translateY(15px);
    opacity: 0;
    position: fixed;
    bottom: 24px;
    right: 24px;
    top: auto !important;
    left: auto !important;
    margin: 0;
    pointer-events: none;
    z-index: 10000;
}

#motionis-chatbot.open #motionis-chatbot-window {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}
#motionis-chatbot.open #motionis-chatbot-icon {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

/* Header */
.cb-header {
    background-color: var(--cb-bg);
    padding: 24px 24px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--cb-border);
    position: relative;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}
.cb-header-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}
.cb-header-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cb-primary), #0096c7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: var(--cb-shadow-sm);
}
.cb-header-avatar svg {
    width: 24px;
    height: 24px;
}
.cb-status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background-color: var(--cb-success);
    border: 2px solid var(--cb-bg);
    border-radius: 50%;
}
.cb-header-text {
    display: flex;
    flex-direction: column;
}
.cb-header-text h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--cb-text);
    line-height: 1.2;
}
.cb-header-text p {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: var(--cb-text-muted);
    font-weight: 500;
}
.cb-header-actions {
    display: flex;
    gap: 8px;
}
.cb-header-actions button {
    background: var(--cb-secondary);
    border: none;
    color: var(--cb-text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}
.cb-header-actions button:hover,
.cb-header-actions button:focus-visible {
    background: var(--cb-secondary-hover);
    color: var(--cb-text);
}

/* Messages Area */
#motionis-chatbot-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    scroll-behavior: smooth;
}

/* Scrollbar styling */
#motionis-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}
#motionis-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}
#motionis-chatbot-messages::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.1);
    border-radius: 10px;
}

/* Empty State / Welcome Area */
.cb-welcome-area {
    text-align: center;
    padding: 24px 12px;
    margin-bottom: 8px;
}
.cb-welcome-icon {
    font-size: 40px;
    margin-bottom: 16px;
}
.cb-welcome-area h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--cb-text);
}
.cb-welcome-area p {
    margin: 0;
    font-size: 14px;
    color: var(--cb-text-muted);
    line-height: 1.6;
}

/* Messages */
.message {
    display: flex;
    gap: 12px;
    max-width: 90%;
    animation: cbMessageSlide 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
    opacity: 0;
    transform: translateY(10px);
}
@keyframes cbMessageSlide {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.message.bot {
    align-self: flex-start;
}
.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cb-primary), #0096c7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--cb-shadow-sm);
    margin-top: auto;
}
.avatar svg {
    width: 16px;
    height: 16px;
}
.message.user .avatar {
    display: none;
}

.bubble {
    padding: 14px 18px;
    border-radius: 20px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    box-shadow: var(--cb-shadow-sm);
}
.message.bot .bubble {
    background-color: var(--cb-bg);
    color: var(--cb-text);
    border: 1px solid var(--cb-border);
    border-bottom-left-radius: 4px;
}
.message.user .bubble {
    background-color: var(--cb-primary);
    color: var(--cb-text-light);
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 119, 182, 0.2);
}

.message.bot .bubble.error {
    background-color: #fef2f2;
    border-color: #fca5a5;
    color: var(--cb-error);
}

/* Typing Indicator */
.typing-indicator .bubble {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 16px 20px;
}
.cb-dot {
    width: 6px;
    height: 6px;
    background-color: #9ca3af;
    border-radius: 50%;
    animation: cbTypingBounce 1.4s infinite cubic-bezier(0.2, 0.68, 0.18, 1.08) both;
}
.cb-dot:nth-child(1) { animation-delay: -0.32s; }
.cb-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes cbTypingBounce {
    0%, 80%, 100% { transform: scale(0.6) translateY(0); opacity: 0.5; }
    40% { transform: scale(1) translateY(-4px); opacity: 1; }
}

/* Review Card */
.review-card {
    background-color: var(--cb-bg);
    border-radius: 12px;
    padding: 12px 16px;
    margin: 4px 0 16px 0;
    box-shadow: var(--cb-shadow-sm);
    border: 1px solid var(--cb-border);
    max-width: 100%;
    box-sizing: border-box;
}
.review-header {
    border-bottom: 1px solid var(--cb-border);
    padding-bottom: 8px;
    margin-bottom: 12px;
}
.review-header h4 {
    margin: 0;
    font-size: 14px;
    color: var(--cb-text);
    font-weight: 700;
}
.review-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.review-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.review-row:last-child {
    margin-bottom: 0;
}
.review-icon {
    font-size: 14px;
    line-height: 1.2;
    padding-top: 2px;
}
.review-details {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}
.review-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--cb-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}
.review-value {
    color: var(--cb-text);
    font-weight: 500;
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
}
.review-long-text.collapsed .text-content {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.review-toggle-btn {
    background: none;
    border: none;
    color: var(--cb-primary);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 0 0 0;
    cursor: pointer;
    font-family: inherit;
    display: inline-block;
}
.review-toggle-btn:hover {
    text-decoration: underline;
}

/* Success Card */
.cb-success-card {
    text-align: center;
    padding: 40px 24px;
    margin: auto;
    animation: cbMessageSlide 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}
.cb-success-icon {
    width: 64px;
    height: 64px;
    background-color: var(--cb-primary-light);
    color: var(--cb-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}
.cb-success-icon svg {
    width: 32px;
    height: 32px;
}
.cb-success-card h3 {
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--cb-text);
}
.cb-success-card p {
    margin: 0;
    font-size: 15px;
    color: var(--cb-text-muted);
    line-height: 1.5;
}

/* Input Area */
#motionis-chatbot-input-container {
    padding: 20px 24px;
    background-color: var(--cb-bg);
    border-top: 1px solid var(--cb-border);
    border-radius: 0 0 24px 24px;
    position: relative;
    z-index: 2;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.02);
}
.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: cbMessageSlide 0.3s forwards;
}

/* Form Controls */
.chat-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--cb-border);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    background-color: var(--cb-app-bg);
    color: var(--cb-text);
    transition: all 0.2s ease;
    box-sizing: border-box;
}
.chat-input::placeholder {
    color: #9ca3af;
}
.chat-input:focus {
    outline: none;
    border-color: var(--cb-primary);
    background-color: var(--cb-bg);
    box-shadow: 0 0 0 3px var(--cb-primary-light);
}
.chat-textarea {
    resize: vertical;
    min-height: 80px;
    max-height: 160px;
}

/* Date & Time Combined Input */
.datetime-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.datetime-input-wrapper label {
    font-size: 14px;
    font-weight: 600;
    color: var(--cb-text);
    margin-bottom: -4px;
    margin-top: 4px;
    display: block;
}
.datetime-input-wrapper label:first-child {
    margin-top: 0;
}
.datetime-input-wrapper .send-btn {
    margin-top: 8px;
    width: 100%;
}

.button-group {
    display: flex;
    gap: 12px;
    flex-direction: column;
}

#motionis-chatbot .btn {
    padding: 14px 20px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    text-decoration: none;
}
#motionis-chatbot .btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

#motionis-chatbot .send-btn {
    padding: 14px 24px;
    border-radius: 30px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--cb-primary), #0096c7);
    color: white !important;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 119, 182, 0.2);
    align-self: flex-end;
}
#motionis-chatbot .send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 119, 182, 0.3);
}
#motionis-chatbot .send-btn:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 119, 182, 0.3);
    outline: 2px solid var(--cb-primary);
    outline-offset: 2px;
}
#motionis-chatbot .send-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(0, 119, 182, 0.2);
}
#motionis-chatbot .send-btn:disabled {
    background: var(--cb-secondary);
    color: var(--cb-text-muted) !important;
    box-shadow: none;
    transform: none;
}

#motionis-chatbot .btn-primary {
    background: linear-gradient(135deg, var(--cb-primary), #0096c7);
    color: var(--cb-text-light) !important;
    box-shadow: 0 4px 12px rgba(0, 119, 182, 0.2);
}
#motionis-chatbot .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 119, 182, 0.3);
}
#motionis-chatbot .btn-primary:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 119, 182, 0.3);
    outline: 2px solid var(--cb-primary);
    outline-offset: 2px;
}
#motionis-chatbot .btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(0, 119, 182, 0.2);
}
#motionis-chatbot .btn-primary:disabled {
    background: #e5e7eb;
    color: #6b7280 !important;
    box-shadow: none;
    transform: none;
}

#motionis-chatbot .btn-secondary {
    background-color: var(--cb-secondary);
    color: var(--cb-text) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
#motionis-chatbot .btn-secondary:hover {
    background-color: #d1d5db; /* Darker grey for better contrast and feedback */
    color: var(--cb-text) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
#motionis-chatbot .btn-secondary:focus-visible {
    background-color: #d1d5db;
    color: var(--cb-text) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    outline: 2px solid var(--cb-primary);
    outline-offset: 2px;
}
#motionis-chatbot .btn-secondary:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
#motionis-chatbot .btn-secondary:disabled {
    background-color: #f3f4f6;
    color: #9ca3af !important;
    box-shadow: none;
    transform: none;
}

.validation-error {
    color: var(--cb-error);
    font-size: 13px;
    font-weight: 500;
    margin-top: -4px;
    padding-left: 4px;
    animation: cbMessageSlide 0.2s forwards;
}

/* Cards UI */
.cb-cards-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.cb-card {
    background-color: var(--cb-bg);
    border: 2px solid var(--cb-border);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}
.cb-card:hover, .cb-card:focus-visible {
    border-color: var(--cb-primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 119, 182, 0.1);
}
.cb-card.selected {
    border-color: var(--cb-primary);
    background-color: var(--cb-primary-light);
}
.cb-card-content h4 {
    margin: 0 0 4px 0;
    font-size: 15px;
    color: var(--cb-text);
}
.cb-card-content p {
    margin: 0;
    font-size: 13px;
    color: var(--cb-text-muted);
}
.cb-card-check {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--cb-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all 0.2s ease;
}
.cb-card-check svg {
    width: 14px;
    height: 14px;
}
.cb-card.selected .cb-card-check {
    background-color: var(--cb-primary);
    border-color: var(--cb-primary);
    color: white;
}

/* Premium Review Card Additions */
.premium-card {
    padding: 0;
    overflow: hidden;
}
.review-header {
    background: linear-gradient(135deg, var(--cb-primary), #0096c7);
    padding: 16px 20px;
    color: white;
}
.review-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}
.review-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.review-row {
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 0;
}
.review-icon {
    font-size: 18px;
    background: var(--cb-app-bg);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
}
.review-details {
    display: flex;
    flex-direction: column;
}


/* Responsive & Mobile Polish */
@media (max-width: 768px) {
    #motionis-chatbot {
        bottom: 16px;
        right: 16px;
    }
    #motionis-chatbot-window {
        width: 340px;
        height: min(650px, 85vh);
        bottom: 16px;
        right: 16px;
    }
}

@media (max-width: 425px) {
    #motionis-chatbot {
        bottom: max(12px, env(safe-area-inset-bottom, 12px));
        right: 12px;
    }
    
    #motionis-chatbot-icon {
        width: 56px;
        height: 56px;
    }
    
    #motionis-chatbot-window {
        width: calc(100vw - 24px); /* 12px margin on both sides */
        height: 65vh; /* Reduced overall height */
        max-height: 550px;
        bottom: max(12px, env(safe-area-inset-bottom, 12px));
        right: 12px;
        border-radius: 20px;
    }
    
    /* Header Optimization */
    .cb-header {
        padding: 12px 16px;
    }
    
    .cb-header-avatar {
        width: 40px;
        height: 40px;
    }
    
    .cb-header-avatar svg {
        width: 20px;
        height: 20px;
    }
    
    .cb-header-text h2 {
        font-size: 15px;
    }
    
    .cb-header-text p {
        font-size: 12px;
    }
    
    /* Message Spacing */
    #motionis-chatbot-messages {
        padding: 16px;
        gap: 16px;
    }
    
    .message {
        max-width: 85%; /* More breathing room */
    }
    
    .bubble {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    /* Input Area */
    #motionis-chatbot-input-container {
        padding: 12px 16px;
        padding-bottom: max(12px, env(safe-area-inset-bottom, 12px));
        border-radius: 0 0 20px 20px;
    }
    
    .input-wrapper {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-end;
        gap: 8px;
    }
    
    .cb-cards-container, .button-group, .datetime-input-wrapper {
        width: 100%;
        box-sizing: border-box;
    }
    
    .chat-input {
        flex: 1;
        min-width: 0;
        min-height: 44px;
        font-size: 16px; /* Prevent iOS zoom */
        padding: 10px 14px;
    }
    
    .btn {
        min-height: 44px;
    }
    
    #motionis-chatbot .send-btn {
        width: auto;
        min-height: 44px;
        padding: 10px 20px;
        font-size: 14px;
        align-self: flex-end;
    }
    
    #motionis-chatbot .datetime-input-wrapper .send-btn {
        width: 100%;
        align-self: center;
    }
    
    #motionis-chatbot .datetime-input-wrapper .chat-input {
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Notification optimization */
    #motionis-chatbot-notification {
        padding: 10px 14px;
        gap: 10px;
    }
    
    .cb-notif-content {
        font-size: 13px;
    }
    
    /* Prevent Accessibility Button from overlapping Chatbot */
    body.cb-open #acc-widget-btn {
        bottom: calc(max(12px, env(safe-area-inset-bottom, 12px)) + min(65vh, 550px) + 16px) !important;
    }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .bounce { animation: none; }
    #motionis-chatbot-window, 
    #motionis-chatbot-notification,
    .message,
    .review-card,
    .cb-success-card,
    .input-wrapper,
    #motionis-chatbot-icon { 
        transition: none; 
        animation: none;
    }
    .cb-dot { 
        animation: none; 
        opacity: 0.7; 
    }
}

/* Autocomplete Input Styles */
.cb-autocomplete-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.cb-autocomplete-input {
    width: 100%;
    padding-right: 36px; /* Space for clear button */
}

.cb-selected-chip {
    background-color: var(--cb-primary-light) !important;
    color: var(--cb-primary) !important;
    border-color: var(--cb-primary) !important;
    font-weight: 600;
    pointer-events: none; /* Make it feel locked */
}

.cb-autocomplete-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: #e5e7eb;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 14px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 5;
}

.cb-autocomplete-clear:hover {
    background: #d1d5db;
    color: #374151;
}

.cb-autocomplete-clear.hidden {
    display: none;
}

.cb-autocomplete-dropdown {
    position: absolute;
    bottom: 100%; /* Show above the input by default to avoid getting clipped */
    left: 0;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background: var(--cb-bg);
    border: 1px solid var(--cb-border);
    border-radius: 12px;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.1);
    margin: 0 0 8px 0;
    padding: 8px 0;
    list-style: none;
    z-index: 100;
}

.cb-autocomplete-dropdown.hidden {
    display: none;
}

.cb-autocomplete-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    color: var(--cb-text);
    transition: background-color 0.2s ease;
}

.cb-autocomplete-item:hover, .cb-autocomplete-item:focus, .cb-autocomplete-item.active {
    background-color: var(--cb-secondary);
}

.cb-autocomplete-item strong {
    color: var(--cb-primary);
    font-weight: 700;
}
