/* Chatbot Widget Styles */
.chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 20px;
    z-index: 9999;
    font-family: 'Poppins', sans-serif;
}

/* Chatbot Button */
.chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #1E4065 !important;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(30, 64, 101, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(30, 64, 101, 0.6);
}

.chatbot-button i {
    color: #fff;
    font-size: 24px;
}

.chatbot-button .notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #ff4757;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #fff;
    font-weight: bold;
    border: 2px solid #fff;
}

/* Chatbot Window */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 600px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.chatbot-window.active {
    display: flex;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chatbot Header */
.chatbot-header {
    background: #1E4065 !important;
    padding: 20px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.chatbot-header-buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.chatbot-header-text h5 {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.chatbot-header-text p {
    margin: 0;
    font-size: 10px;
    opacity: 0.9;
    color: white;
}

.chatbot-reset {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chatbot-reset:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(180deg);
}

.chatbot-reset i {
    font-size: 12px;
}

.chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Chatbot Messages Area */
.chatbot-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Message Bubbles */
.message {
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.message.bot .message-avatar {
    background: #1E4065 !important;
    color: #fff;
}

.message.user .message-avatar {
    background: #e9ecef;
    color: #495057;
}

.message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 14px;
}

.message.bot .message-content {
    background: #fff;
    color: #333;
    border: 1px solid #e0e0e0;
    /* Added border for better visibility */
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    /* Softer shadow */
}

.message.user .message-content {
    background: #1E4065 !important;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 5px;
    text-align: right;
}

.message.user .message-time {
    text-align: left;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #667eea;
    animation: typing 1.4s infinite;
}

.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.7;
    }

    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Chatbot Input Area */
.chatbot-input-area {
    padding: 15px;
    background: #fff;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    border: 1px solid #e9ecef;
    border-radius: 25px;
    padding: 12px 20px;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.chatbot-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chatbot-send {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #1E4065 !important;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chatbot-send:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: scale(1);
}

/* Welcome Message */
.welcome-message {
    text-align: center;
    padding: 20px;
    color: #666;
}

.welcome-message h5 {
    color: #333;
    margin-bottom: 10px;
    font-size: 16px;
}

.welcome-message p {
    font-size: 13px;
    margin: 0;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.quick-action-btn {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #495057;
}

.quick-action-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-color: transparent;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 480px) {
    .chatbot-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 100px);
        right: 20px;
        bottom: 80px;
    }

    .chatbot-container {
        bottom: 15px;
        right: 15px;
    }
}

/* Animation for button pulse */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(30, 64, 101, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(30, 64, 101, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(30, 64, 101, 0);
    }
}

.chatbot-button.pulse {
    animation: pulse 2s infinite;
}

/* --- In-Chat Login Styles --- */
.chatbot-header-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.chatbot-login-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chatbot-login-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chatbot-login-btn i {
    font-size: 12px;
}

.chatbot-login-form-container {
    position: absolute;
    top: 70px;
    /* Below header */
    left: 0;
    width: 100%;
    background: #fff;
    padding: 25px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    display: none;
    /* Hidden by default */
    animation: slideDown 0.3s ease;
    /* For close button positioning */
    position: absolute;
}

.login-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    z-index: 1001;
}

.login-close-btn:hover {
    color: #333;
}


.chatbot-login-form-container.active {
    display: block;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.login-input-group {
    margin-bottom: 15px;
}

.login-input-group label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.login-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.login-input:focus {
    border-color: #667eea;
}

.login-submit-btn {
    width: 100%;
    background: #1E4065 !important;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
}

.login-error {
    color: #dc3545;
    font-size: 12px;
    margin-bottom: 10px;
    text-align: center;
    display: none;
}

.chat-login-links {
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
}

.chat-login-links:hover {
    text-decoration: underline;
}