/* SmansaBanjarBot - Floating Chat Widget */

/* TEMPORARY: Hide chatbot */
.chat-toggle,
.chat-window {
    display: none !important;
}

/* Chat Toggle Button */
.chat-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #003B7A 0%, #0056b3 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 59, 122, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9998;
    color: white;
    animation: pulse 2s infinite;
}

.chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(0, 59, 122, 0.5);
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #F4D03F;
    color: #003B7A;
    font-size: 0.75rem;
    font-weight: 700;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid white;
    animation: bounce 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 8px 24px rgba(0, 59, 122, 0.4);
    }
    50% {
        box-shadow: 0 8px 24px rgba(0, 59, 122, 0.6), 0 0 0 12px rgba(0, 59, 122, 0.1);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

/* Chat Window */
.chat-window {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 380px;
    height: 600px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    overflow: hidden;
}

.chat-window.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #003B7A 0%, #0056b3 100%);
    color: white;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 20px 20px 0 0;
}

.chat-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: white;
    padding: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.chat-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.chat-status {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.9;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #4ade80;
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.chat-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background: linear-gradient(135deg, rgba(0, 59, 122, 0.03) 0%, rgba(244, 208, 63, 0.03) 100%);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 59, 122, 0.3);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 59, 122, 0.5);
}

/* Message Bubbles */
.chat-message {
    display: flex;
    gap: 0.75rem;
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-message {
    align-self: flex-start;
}

.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    padding: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.message-content {
    max-width: 75%;
}

.message-text {
    background: white;
    padding: 0.875rem 1.125rem;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    font-size: 0.95rem;
    line-height: 1.5;
    color: #1f2937;
    word-wrap: break-word;
}

.user-message .message-text {
    background: linear-gradient(135deg, #003B7A 0%, #0056b3 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.bot-message .message-text {
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.35rem;
    padding: 0 0.5rem;
}

.user-message .message-time {
    text-align: right;
}

/* Typing Indicator */
.typing-indicator .message-text {
    padding: 0.75rem 1rem;
    display: inline-block;
}

.typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #003B7A;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* Chat Input */
.chat-input-container {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.chat-input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 2px solid rgba(0, 59, 122, 0.15);
    border-radius: 12px;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s;
    background: rgba(0, 59, 122, 0.03);
}

.chat-input:focus {
    border-color: #003B7A;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 59, 122, 0.1);
}

.chat-input::placeholder {
    color: #9ca3af;
}

.chat-send {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #003B7A 0%, #0056b3 100%);
    border: none;
    border-radius: 12px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.chat-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 59, 122, 0.4);
}

.chat-send:active {
    transform: scale(0.95);
}

/* Chat Footer */
.chat-footer {
    padding: 0.75rem;
    text-align: center;
    font-size: 0.75rem;
    color: #9ca3af;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 0 0 20px 20px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chat-window {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .chat-header {
        border-radius: 0;
    }

    .chat-toggle {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 56px;
        height: 56px;
    }

    .message-content {
        max-width: 85%;
    }
}
