/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&family=Hind:wght@300;400;500;600;700&display=swap');

/* AI Assistant Widget Styles - Clean Design */
.ai-assistant-widget {
    position: fixed;
    z-index: 9999;
    font-family: var(--ai-font-family, 'Hind', 'Arial', sans-serif);
}

.ai-assistant-widget.bottom-right {
    bottom: 20px;
    right: 20px;
}

.ai-assistant-widget.bottom-left {
    bottom: 20px;
    left: 20px;
}

.ai-assistant-widget.top-right {
    top: 20px;
    right: 20px;
}

.ai-assistant-widget.top-left {
    top: 20px;
    left: 20px;
}

.ai-assistant-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--ai-primary-color, #00272b);
    color: #BEFA4F;
    border: 3px solid #BEFA4F;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 39, 43, 0.3);
}

.ai-assistant-chat {
    width: 380px;
    height: 520px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 39, 43, 0.2);
    display: flex;
    flex-direction: column;
    position: absolute;
    bottom: 70px;
    right: 0;
    overflow: hidden;
    border: 3px solid var(--ai-primary-color, #00272b);
}

.ai-assistant-widget.bottom-left .ai-assistant-chat,
.ai-assistant-widget.top-left .ai-assistant-chat {
    right: auto;
    left: 0;
}

.ai-assistant-widget.top-right .ai-assistant-chat,
.ai-assistant-widget.top-left .ai-assistant-chat {
    bottom: auto;
    top: 70px;
}

.ai-assistant-header {
    background: var(--ai-primary-color, #00272b);
    color: #BEFA4F;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    border-bottom: 2px solid #BEFA4F;
}

.ai-assistant-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.ai-assistant-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #BEFA4F;
    color: #00272b;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid #BEFA4F;
    font-weight: 700;
}

.ai-assistant-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ai-assistant-details {
    min-width: 0;
    flex: 1;
}

.ai-assistant-name {
    font-weight: 700;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Montserrat', sans-serif;
    color: #BEFA4F;
}

.ai-assistant-status {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Hind', sans-serif;
    color: white;
}

.ai-assistant-close {
    background: none;
    border: 2px solid #BEFA4F;
    color: #BEFA4F;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.ai-assistant-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: var(--ai-secondary-color, #ffffff);
    min-height: 0;
}

.ai-assistant-message {
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    word-wrap: break-word;
}

.ai-assistant-message.user-message {
    flex-direction: row-reverse;
}

.ai-assistant-message-content {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ai-text-color, #00272b);
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    font-family: 'Hind', sans-serif;
    font-weight: 500;
    border: 2px solid;
}

.ai-message .ai-assistant-message-content {
    background: #BEFA4F;
    color: #00272b;
    border-color: #00272b;
    border-radius: 12px 12px 12px 4px;
}

.user-message .ai-assistant-message-content {
    background: var(--ai-primary-color, #00272b);
    color: #BEFA4F;
    border-color: #BEFA4F;
    border-radius: 12px 12px 4px 12px;
}

.ai-assistant-message-content a {
    color: inherit;
    text-decoration: underline;
    word-break: break-all;
    font-weight: 600;
}

.user-message .ai-assistant-message-content a {
    color: #BEFA4F;
}

.ai-assistant-input-container {
    padding: 16px;
    border-top: 2px solid #00272b;
    display: flex;
    gap: 8px;
    background: white;
    flex-shrink: 0;
}

.ai-assistant-input-container input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #00272b;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
    font-family: 'Hind', sans-serif;
    min-width: 0;
    font-weight: 500;
}

.ai-assistant-input-container input:focus {
    border-color: #BEFA4F;
}

.ai-assistant-input-container button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #BEFA4F;
    color: #00272b;
    border: 2px solid #00272b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-assistant-input-container button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ai-assistant-footer {
    padding: 8px 16px;
    text-align: center;
    border-top: 2px solid #00272b;
    background: #BEFA4F;
    flex-shrink: 0;
}

.ai-assistant-footer small {
    color: #00272b;
    font-size: 11px;
    font-family: 'Hind', sans-serif;
    font-weight: 600;
}

.ai-assistant-footer a {
    color: #00272b;
    text-decoration: none;
    font-weight: 700;
}

.ai-assistant-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: #BEFA4F;
    border: 2px solid #00272b;
    border-radius: 12px;
    max-width: 85%;
}

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

.ai-assistant-typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.ai-assistant-typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ai-assistant-widget {
        position: fixed !important;
        z-index: 9999 !important;
        bottom: 20px !important;
        top: auto !important;
    }
    
    .ai-assistant-widget.bottom-right,
    .ai-assistant-widget.top-right {
        bottom: 20px !important;
        right: 20px !important;
        top: auto !important;
        left: auto !important;
    }
    
    .ai-assistant-widget.bottom-left,
    .ai-assistant-widget.top-left {
        bottom: 20px !important;
        left: 20px !important;
        top: auto !important;
        right: auto !important;
    }
    
    .ai-assistant-chat {
        width: calc(100vw - 40px) !important;
        height: calc(100vh - 200px) !important;
        max-width: 380px !important;
        max-height: 450px !important;
        bottom: 70px !important;
        top: auto !important;
        position: absolute !important;
    }
    
    .ai-assistant-widget.bottom-left .ai-assistant-chat,
    .ai-assistant-widget.top-left .ai-assistant-chat {
        left: 0 !important;
        right: auto !important;
        bottom: 70px !important;
        top: auto !important;
    }
    
    .ai-assistant-widget.bottom-right .ai-assistant-chat,
    .ai-assistant-widget.top-right .ai-assistant-chat {
        right: 0 !important;
        left: auto !important;
        bottom: 70px !important;
        top: auto !important;
    }
    
    .ai-assistant-toggle {
        width: 56px;
        height: 56px;
    }
    
    .ai-assistant-header {
        padding: 12px 14px;
    }
    
    .ai-assistant-name {
        font-size: 16px;
    }
    
    .ai-assistant-status {
        font-size: 12px;
    }
    
    .ai-assistant-messages {
        padding: 12px;
    }
    
    .ai-assistant-message-content {
        max-width: 90%;
        font-size: 16px;
        padding: 10px 14px;
    }
    
    .ai-assistant-input-container {
        padding: 12px;
    }
    
    .ai-assistant-input-container input {
        font-size: 16px;
        padding: 10px 14px;
        min-height: 40px;
    }
    
    .ai-assistant-input-container button {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }
    
    .ai-assistant-footer {
        padding: 6px 12px;
    }
    
    .ai-assistant-footer small {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .ai-assistant-widget {
        position: fixed !important;
        z-index: 9999 !important;
        bottom: 15px !important;
        top: auto !important;
    }
    
    .ai-assistant-widget.bottom-right,
    .ai-assistant-widget.top-right {
        bottom: 15px !important;
        right: 15px !important;
        top: auto !important;
        left: auto !important;
    }
    
    .ai-assistant-widget.bottom-left,
    .ai-assistant-widget.top-left {
        bottom: 15px !important;
        left: 15px !important;
        top: auto !important;
        right: auto !important;
    }
    
    .ai-assistant-chat {
        width: calc(100vw - 30px) !important;
        height: calc(100vh - 180px) !important;
        max-height: 400px !important;
        bottom: 65px !important;
        top: auto !important;
        position: absolute !important;
    }
    
    .ai-assistant-widget.bottom-left .ai-assistant-chat,
    .ai-assistant-widget.top-left .ai-assistant-chat {
        left: 0 !important;
        right: auto !important;
        bottom: 65px !important;
        top: auto !important;
    }
    
    .ai-assistant-widget.bottom-right .ai-assistant-chat,
    .ai-assistant-widget.top-right .ai-assistant-chat {
        right: 0 !important;
        left: auto !important;
        bottom: 65px !important;
        top: auto !important;
    }
    
    .ai-assistant-toggle {
        width: 50px;
        height: 50px;
    }
    
    .ai-assistant-header {
        padding: 10px 12px;
    }
    
    .ai-assistant-name {
        font-size: 16px;
    }
    
    .ai-assistant-status {
        font-size: 12px;
    }
    
    .ai-assistant-messages {
        padding: 10px;
    }
    
    .ai-assistant-message-content {
        font-size: 16px;
        padding: 8px 12px;
    }
    
    .ai-assistant-input-container {
        padding: 10px;
    }
    
    .ai-assistant-input-container input {
        font-size: 16px;
        padding: 10px 14px;
        min-height: 42px;
    }
    
    .ai-assistant-input-container button {
        width: 42px;
        height: 42px;
        min-width: 42px;
        min-height: 42px;
    }
    
    .ai-assistant-footer {
        padding: 4px 8px;
    }
    
    .ai-assistant-footer small {
        font-size: 9px;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .ai-assistant-chat {
        height: calc(100vh - 120px) !important;
        max-height: 350px !important;
    }
    
    .ai-assistant-header {
        padding: 8px 12px;
    }
    
    .ai-assistant-messages {
        padding: 8px;
    }
    
    .ai-assistant-input-container {
        padding: 8px;
    }
}

/* Force bottom positioning on mobile */
@media (max-width: 768px) {
    .ai-assistant-widget[class*="top-"] {
        top: auto !important;
        bottom: 20px !important;
    }
    
    .ai-assistant-widget[class*="top-"] .ai-assistant-chat {
        top: auto !important;
        bottom: 70px !important;
    }
}

@media (max-width: 480px) {
    .ai-assistant-widget[class*="top-"] {
        top: auto !important;
        bottom: 15px !important;
    }
    
    .ai-assistant-widget[class*="top-"] .ai-assistant-chat {
        top: auto !important;
        bottom: 65px !important;
    }
}

/* Scrollbar styling */
.ai-assistant-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-assistant-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.ai-assistant-messages::-webkit-scrollbar-thumb {
    background: #00272b;
    border-radius: 3px;
}

.ai-assistant-messages::-webkit-scrollbar-thumb:hover {
    background: #BEFA4F;
}