@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');
#atlas-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
}

#atlas-chat-button {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 200px;
    min-height: 48px;
}

#atlas-chat-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

#atlas-chat-button.atlas-chat-closed {
    animation: pulse 2s infinite;
}

.atlas-chat-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.atlas-chat-text {
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
}

#atlas-chat-container {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 380px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: bottom right;
}

#atlas-chat-container.atlas-chat-hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8) translateY(20px);
}

#atlas-chat-container.atlas-chat-visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

.atlas-chat-header {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.atlas-header-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.atlas-avatar {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.atlas-header-title {
    font-weight: 600;
    font-size: 16px;
}

.atlas-close-button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.atlas-close-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.atlas-messages-area {
    max-height: 320px;
    min-height: 120px;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.atlas-messages-area::-webkit-scrollbar {
    width: 4px;
}

.atlas-messages-area::-webkit-scrollbar-track {
    background: transparent;
}

.atlas-messages-area::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

.atlas-messages-area::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.atlas-message {
    max-width: 85%;
    word-wrap: break-word;
    line-height: 1.5;
    animation: messageSlideIn 0.3s ease-out;
}

.atlas-message-bot {
    align-self: flex-start;
}

.atlas-message-user {
    align-self: flex-end;
}

.atlas-message-content {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
}

.atlas-message-bot .atlas-message-content {
    background: #f3f4f6;
    color: #374151;
    border-bottom-left-radius: 6px;
}

.atlas-message-user .atlas-message-content {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    border-bottom-right-radius: 6px;
}

.atlas-input-section {
    border-top: 1px solid #e5e7eb;
    padding: 16px 20px;
    background: #fafafa;
}

.atlas-input-container {
    display: flex;
    gap: 8px;
    align-items: center;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 4px;
    transition: border-color 0.2s;
}

.atlas-input-container:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#atlas-message-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    background: transparent;
    color: #374151;
}

#atlas-message-input::placeholder {
    color: #9ca3af;
}

.atlas-send-button {
    background: #6366f1;
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.atlas-send-button:hover:not(:disabled) {
    background: #4f46e5;
    transform: scale(1.05);
}

.atlas-send-button:disabled {
    background: #d1d5db;
    cursor: not-allowed;
    transform: none;
}

.atlas-disclaimer {
    font-size: 11px;
    color: #6b7280;
    margin-top: 8px;
    line-height: 1.4;
}

.atlas-typing-indicator {
    display: none;
    padding: 16px 20px 0;
    align-items: center;
    gap: 8px;
}

.atlas-typing-indicator.atlas-show {
    display: flex;
}

.atlas-typing-dots {
    display: flex;
    gap: 3px;
}

.atlas-typing-dots span {
    width: 6px;
    height: 6px;
    background: #6b7280;
    border-radius: 50%;
    animation: typingDots 1.4s infinite ease-in-out;
}

.atlas-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.atlas-typing-dots span:nth-child(2) { animation-delay: -0.16s; }

.atlas-typing-text {
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes typingDots {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 480px) {
    #atlas-chat-widget {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }
    
    #atlas-chat-button {
        width: 100%;
        justify-content: center;
        max-width: none;
    }
    
    #atlas-chat-container {
        width: 100%;
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        border-radius: 16px 16px 0 0;
        transform-origin: bottom center;
    }
    
    .atlas-messages-area {
        max-height: 280px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

#atlas-chat-button:focus,
.atlas-close-button:focus,
.atlas-send-button:focus {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

#atlas-message-input:focus {
    outline: none;
}

