/* EVE Online AI Chatbot Widget Styling */

:root {
    --chat-bg: rgba(10, 14, 22, 0.85);
    --chat-border: rgba(0, 217, 255, 0.25);
    --chat-border-glow: rgba(0, 217, 255, 0.4);
    --chat-accent: #00d9ff;
    --chat-text: #e2e8f0;
    --chat-text-muted: #94a3b8;
    --chat-user-msg: rgba(0, 217, 255, 0.15);
    --chat-bot-msg: rgba(30, 41, 59, 0.7);
}

.chat-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Floating Toggle Button */
.chat-widget-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle, #0e1726 0%, #050a12 100%);
    border: 2px solid var(--chat-border);
    box-shadow: 0 0 15px rgba(0, 217, 255, 0.2), inset 0 0 10px rgba(0, 217, 255, 0.1);
    color: var(--chat-accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.chat-widget-button:hover {
    transform: translateY(-3px) scale(1.05);
    border-color: var(--chat-accent);
    box-shadow: 0 0 25px rgba(0, 217, 255, 0.5), inset 0 0 10px rgba(0, 217, 255, 0.2);
}

.chat-widget-button svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

.chat-widget-button.active svg {
    transform: rotate(90deg);
}

/* Chat Window Box */
.chat-window {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 380px;
    height: 520px;
    background: var(--chat-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--chat-border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 217, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    pointer-events: none;
}

.chat-window.open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
    border-color: var(--chat-border-glow);
}

/* Chat Header */
.chat-header {
    padding: 15px;
    background: rgba(15, 23, 42, 0.8);
    border-bottom: 1px solid var(--chat-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-header-title h4 {
    margin: 0;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 0 8px rgba(0, 217, 255, 0.3);
}

.chat-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #10b981;
    box-shadow: 0 0 8px #10b981;
    display: inline-block;
}

.chat-close-btn {
    background: transparent;
    border: none;
    color: var(--chat-text-muted);
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.chat-close-btn:hover {
    color: #ef4444;
}

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

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

.chat-message-bubble.user {
    align-self: flex-end;
    background-color: var(--chat-user-msg);
    color: #fff;
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-bottom-right-radius: 2px;
}

.chat-message-bubble.assistant {
    align-self: flex-start;
    background-color: var(--chat-bot-msg);
    color: var(--chat-text);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom-left-radius: 2px;
}

.chat-message-bubble.assistant p {
    margin: 0 0 8px 0;
}
.chat-message-bubble.assistant p:last-child {
    margin: 0;
}
.chat-message-bubble.assistant ul, .chat-message-bubble.assistant ol {
    margin: 5px 0;
    padding-left: 20px;
}

/* Typing Indicator */
.chat-typing-indicator {
    align-self: flex-start;
    background-color: var(--chat-bot-msg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-bottom-left-radius: 2px;
    padding: 12px 16px;
    display: flex;
    gap: 4px;
}

.chat-typing-dot {
    width: 6px;
    height: 6px;
    background-color: var(--chat-text-muted);
    border-radius: 50%;
    animation: chat-bounce 1.4s infinite ease-in-out both;
}

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

@keyframes chat-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* Chat Input Bar */
.chat-input-container {
    padding: 12px;
    background: rgba(15, 23, 42, 0.8);
    border-top: 1px solid var(--chat-border);
    display: flex;
    gap: 8px;
}

.chat-input-field {
    flex: 1;
    background: rgba(5, 10, 18, 0.6);
    border: 1px solid var(--chat-border);
    border-radius: 6px;
    padding: 10px 12px;
    color: #fff;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
}

.chat-input-field:focus {
    border-color: var(--chat-accent);
    box-shadow: 0 0 8px rgba(0, 217, 255, 0.2);
}

.chat-send-btn {
    background: var(--chat-accent);
    color: #000;
    border: none;
    border-radius: 6px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.chat-send-btn:hover {
    background: #55eaff;
    box-shadow: 0 0 10px rgba(0, 217, 255, 0.4);
    transform: scale(1.03);
}

.chat-send-btn:active {
    transform: scale(0.97);
}

.chat-send-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Scrollbar Customization */
.chat-messages::-webkit-scrollbar {
    width: 5px;
}
.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 217, 255, 0.2);
}

/* Responsive adjustment */
@media (max-width: 480px) {
    .chat-window {
        width: calc(100vw - 40px);
        height: 70vh;
        max-height: 480px;
    }
}
