/* Chat Widget Styles */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.chat-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--color-primary);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
}

.chat-icon {
    font-size: 24px;
}

.chat-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background-color: #1e293b;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease;
    border: 1px solid #334155;
}

.chat-container.active {
    transform: scale(1);
}

.chat-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
    padding: 15px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #334155;
}

.chat-header h3 {
    margin: 0;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.7;
}

.close-chat:hover {
    opacity: 1;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    max-width: 80%;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.message.bot {
    background-color: #334155;
    color: #e2e8f0;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.message.user {
    background-color: var(--color-primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.chat-input-area {
    padding: 15px;
    background-color: #0f172a;
    border-top: 1px solid #334155;
    display: flex;
    gap: 10px;
}

.chat-input-area input {
    flex: 1;
    padding: 10px;
    border-radius: 20px;
    border: 1px solid #334155;
    background-color: #1e293b;
    color: white;
    outline: none;
}

.chat-input-area input:focus {
    border-color: var(--color-primary);
}

.send-btn {
    background-color: var(--color-primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.send-btn:hover {
    background-color: #2563eb;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 12px;
    background-color: #334155;
    border-radius: 10px;
    width: fit-content;
    margin-bottom: 10px;
    display: none;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background-color: #94a3b8;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

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

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

/* Blinking Text Animation */
@keyframes blink-animation {
    0% { opacity: 1; text-shadow: 0 0 5px rgba(239, 68, 68, 0.5); }
    50% { opacity: 0.6; text-shadow: 0 0 15px rgba(239, 68, 68, 0.8); }
    100% { opacity: 1; text-shadow: 0 0 5px rgba(239, 68, 68, 0.5); }
}

.blinking-text {
    animation: blink-animation 2s infinite ease-in-out;
    color: #ef4444 !important; /* Red-500 */
    font-weight: bold;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chat-container {
        width: calc(100vw - 40px);
        bottom: 90px;
        right: 0;
        left: 0;
        margin: 0 auto;
        height: 60vh;
    }
}
