.chatbot-widget {
    position: fixed;
    bottom: 10px;
    right: 10px;
    width: 60px;  /* Very small width */
    height: 60px; /* Very small height */
    background: white;
    border-radius: 50%; /* Make it circular */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 999999;
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    overflow: hidden;
    cursor: pointer;
}

/* Initial minimized state - just show icon/header */
.chatbot-widget:not(.chatbot-expanded) .chatbot-header {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%); /* Green gradient */
}

.chatbot-widget:not(.chatbot-expanded) .chatbot-header h3 {
    display: none; /* Hide title when minimized */
}

.chatbot-widget:not(.chatbot-expanded) .chatbot-header-buttons {
    display: none; /* Hide buttons when minimized */
}

/* Chat icon for minimized state */
.chatbot-widget:not(.chatbot-expanded) .chatbot-header::before {
    content: "💬";
    font-size: 24px;
    color: white;
}

/* Expanded state - normal size */
.chatbot-widget.chatbot-expanded {
    width: 350px;
    height: 500px;
    border-radius: 12px;
}

.chatbot-widget.chatbot-expanded .chatbot-header {
    border-radius: 12px 12px 0 0;
    padding: 18px 20px;
    height: auto;
    justify-content: space-between;
}

.chatbot-widget.chatbot-expanded .chatbot-header::before {
    display: none; /* Hide chat icon when expanded */
}

.chatbot-widget.chatbot-expanded .chatbot-header h3 {
    display: block;
}

.chatbot-widget.chatbot-expanded .chatbot-header-buttons {
    display: flex;
}

/* RTL support */
.chatbot-widget.chatbot-rtl {
    direction: rtl;
    text-align: right;
    left: 10px;
    right: auto;
}

.chatbot-header {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
    padding: 18px 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.chatbot-header-buttons {
    display: flex;
    gap: 12px;
}

.chatbot-toggle,
.chatbot-close {
    background: rgba(255, 255, 255, 0.25);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 300;
    line-height: 1;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.chatbot-toggle {
    width: 36px;
    height: 36px;
    font-size: 28px;
    font-family: Arial, sans-serif;
}

.chatbot-close {
    width: 36px;
    height: 36px;
    font-size: 32px;
    font-family: 'Arial', sans-serif;
    font-weight: 200;
}

.chatbot-toggle:hover,
.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.chatbot-toggle:active,
.chatbot-close:active {
    transform: scale(0.95);
    transition: transform 0.1s;
}

.chatbot-toggle:focus,
.chatbot-close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.chatbot-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    background: #fafafa;
}

.chatbot-widget:not(.chatbot-expanded) .chatbot-body {
    display: none;
}

.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: linear-gradient(180deg, #f9f9f9 0%, #f5f5f5 100%);
    scrollbar-width: thin;
    scrollbar-color: #c1c1c1 transparent;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background-color: #c1c1c1;
    border-radius: 3px;
}

.chatbot-input {
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    background: white;
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.chatbot-input input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 28px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: #f8f9fa;
}

.chatbot-input input:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
    background: white;
}

.chatbot-input button {
    padding: 14px 24px;
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
    border: none;
    border-radius: 28px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: all 0.3s;
    min-width: 60px;
}

.chatbot-input button:hover {
    background: linear-gradient(135deg, #005a87 0%, #004a70 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.2);
}

.chatbot-input button:active {
    transform: translateY(0);
}

.message {
    margin: 12px 0;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-content {
    padding: 14px 18px;
    border-radius: 20px;
    display: inline-block;
    max-width: 85%;
    word-wrap: break-word;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.user-message {
    text-align: right;
}

.user-message .message-content {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
    border-bottom-right-radius: 8px;
    text-align: left;
}

.bot-message {
    text-align: left;
}

.bot-message .message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 8px;
    border: 1px solid #e0e0e0;
}

.chatbot-rtl .user-message {
    text-align: left;
}

.chatbot-rtl .bot-message {
    text-align: right;
}

.typing-indicator {
    display: inline-flex;
    gap: 6px;
    padding: 4px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #007cba;
    border-radius: 50%;
    display: inline-block;
    animation: typing 1.4s infinite ease-in-out;
    opacity: 0.7;
}

.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Hover effect for minimized state */
.chatbot-widget:not(.chatbot-expanded):hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

@media (max-width: 480px) {
    .chatbot-widget.chatbot-expanded {
        width: calc(100% - 40px);
        right: 20px;
        bottom: 20px;
        height: 450px;
    }
    
    .chatbot-widget:not(.chatbot-expanded) {
        width: 60px;
        height: 60px;
        bottom: 10px;
        right: 10px;
    }
    
    .chatbot-header-buttons {
        gap: 8px;
    }
    
    .chatbot-toggle,
    .chatbot-close {
        width: 32px;
        height: 32px;
    }
    
    .chatbot-toggle {
        font-size: 24px;
    }
    
    .chatbot-close {
        font-size: 28px;
    }
    
    .chatbot-input {
        padding: 15px;
    }
    
    .chatbot-input input {
        padding: 12px 16px;
    }
    
    .chatbot-input button {
        padding: 12px 20px;
    }
}