/* Atlas Chatbot Styles */
/* Matches Cal Strong dark aesthetic: #0a0a0a backgrounds, #2d8c3c green accents */

/* Toggle Button - Bottom Right Corner */
.atlas-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border: 3px solid #2d8c3c;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(45, 140, 60, 0.4);
    transition: all 0.3s ease;
    z-index: 99999;
    animation: atlas-pulse 2s ease-in-out infinite;
    pointer-events: auto;
}

.atlas-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(45, 140, 60, 0.6);
}

.atlas-toggle img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
}

/* Pulse Animation */
@keyframes atlas-pulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(45, 140, 60, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(45, 140, 60, 0.7), 0 0 0 8px rgba(45, 140, 60, 0.1);
    }
}

/* Chat Container */
.atlas-chat {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 550px;
    max-height: calc(100vh - 140px);
    background: #0a0a0a;
    border: 2px solid #2d8c3c;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.atlas-chat.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Chat Header */
.atlas-chat-header {
    background: linear-gradient(135deg, #2d8c3c 0%, #247a32 100%);
    padding: 16px 20px;
    border-radius: 14px 14px 0 0;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.atlas-chat-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    object-fit: cover;
}

.atlas-chat-title {
    flex: 1;
}

.atlas-chat-title h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
}

.atlas-chat-title p {
    margin: 2px 0 0 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
}

.atlas-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.atlas-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: rotate(90deg);
}

/* Chat Messages Area */
.atlas-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.atlas-chat-messages::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.atlas-chat-messages::-webkit-scrollbar-thumb {
    background: #2d8c3c;
    border-radius: 3px;
}

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

@keyframes atlas-message-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.atlas-message.atlas {
    align-items: flex-start;
}

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

.atlas-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.atlas-message-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.atlas-message.atlas .atlas-message-bubble {
    background: #1a1a1a;
    border: 1px solid #2d8c3c;
    color: #ffffff;
    border-bottom-left-radius: 4px;
}

.atlas-message.user .atlas-message-bubble {
    background: #2d8c3c;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.atlas-message-bubble a {
    color: #4ade80;
    text-decoration: underline;
}

.atlas-message-bubble a:hover {
    color: #86efac;
}

/* Quick Reply Buttons */
.atlas-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    padding-left: 42px;
}

.atlas-quick-reply-btn {
    background: #1a1a1a;
    border: 1px solid #2d8c3c;
    color: #2d8c3c;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.atlas-quick-reply-btn:hover {
    background: #2d8c3c;
    color: #ffffff;
}

/* Chat Input Area */
.atlas-chat-input {
    border-top: 1px solid #2d8c3c;
    padding: 16px 20px;
    display: flex;
    gap: 12px;
    background: #0a0a0a;
    border-radius: 0 0 14px 14px;
}

.atlas-chat-input input {
    flex: 1;
    background: #1a1a1a;
    border: 1px solid #333333;
    border-radius: 24px;
    padding: 10px 16px;
    color: #ffffff;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.atlas-chat-input input:focus {
    border-color: #2d8c3c;
    box-shadow: 0 0 0 3px rgba(45, 140, 60, 0.15);
}

.atlas-chat-input input::placeholder {
    color: #666666;
}

.atlas-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2d8c3c 0%, #247a32 100%);
    border: none;
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.atlas-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(45, 140, 60, 0.4);
}

.atlas-send-btn:active {
    transform: scale(0.95);
}

.atlas-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Typing Indicator */
.atlas-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #1a1a1a;
    border: 1px solid #2d8c3c;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    max-width: 60px;
    margin-left: 42px;
}

.atlas-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #2d8c3c;
    animation: atlas-typing-bounce 1.4s infinite;
}

.atlas-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.atlas-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes atlas-typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .atlas-toggle {
        bottom: 20px;
        right: 20px;
        width: 60px;
        height: 60px;
    }
    
    .atlas-toggle img {
        width: 46px;
        height: 46px;
    }
    
    .atlas-chat {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        border: none;
    }
    
    .atlas-chat-header {
        border-radius: 0;
        padding: 20px;
    }
    
    .atlas-chat-input {
        border-radius: 0;
        padding: 16px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .atlas-toggle,
    .atlas-chat,
    .atlas-message,
    .atlas-send-btn {
        animation: none;
        transition: none;
    }
}
