/* Aether Nexus™ Chat Bubble and Interface Styles */

/* Chat Bubble Container */
.aether-nexus-container {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.aether-nexus-container.bottom-right {
    bottom: 20px;
    right: 20px;
}

.aether-nexus-container.bottom-left {
    bottom: 20px;
    left: 20px;
}

.aether-nexus-container.top-right {
    top: 20px;
    right: 20px;
}

.aether-nexus-container.top-left {
    top: 20px;
    left: 20px;
}

/* Glowing Teal Chat Bubble */
.aether-nexus-bubble {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 4px 20px rgba(20, 184, 166, 0.4),
        0 0 0 0 rgba(20, 184, 166, 0.7);
    animation: aether-pulse 2s infinite;
    position: relative;
    overflow: hidden;
}

.aether-nexus-bubble::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #14b8a6, #06b6d4, #8b5cf6, #14b8a6);
    border-radius: 50%;
    z-index: -1;
    animation: aether-rotate 3s linear infinite;
    opacity: 0.8;
}

.aether-nexus-bubble:hover {
    transform: scale(1.1);
    box-shadow: 
        0 8px 30px rgba(20, 184, 166, 0.6),
        0 0 0 10px rgba(20, 184, 166, 0.1);
}

.aether-nexus-bubble:active {
    transform: scale(0.95);
}

/* Chat Icon */
.aether-nexus-icon {
    width: 28px;
    height: 28px;
    fill: white;
    transition: transform 0.3s ease;
}

.aether-nexus-bubble:hover .aether-nexus-icon {
    transform: scale(1.1);
}

/* Pulse Animation */
@keyframes aether-pulse {
    0% {
        box-shadow: 
            0 4px 20px rgba(20, 184, 166, 0.4),
            0 0 0 0 rgba(20, 184, 166, 0.7);
    }
    70% {
        box-shadow: 
            0 4px 20px rgba(20, 184, 166, 0.4),
            0 0 0 10px rgba(20, 184, 166, 0);
    }
    100% {
        box-shadow: 
            0 4px 20px rgba(20, 184, 166, 0.4),
            0 0 0 0 rgba(20, 184, 166, 0);
    }
}

/* Rotating Border Animation */
@keyframes aether-rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Chat Interface */
.aether-nexus-chat {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 500px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px) scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.aether-nexus-chat.active {
    display: flex;
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Chat Header */
.aether-nexus-header {
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.aether-nexus-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: aether-shimmer 3s infinite;
}

@keyframes aether-shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

.aether-nexus-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.aether-nexus-status {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: aether-pulse-dot 2s infinite;
}

@keyframes aether-pulse-dot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

.aether-nexus-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.aether-nexus-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Chat Messages */
.aether-nexus-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: linear-gradient(180deg, rgba(20, 184, 166, 0.02), rgba(20, 184, 166, 0.05));
}

.aether-nexus-messages::-webkit-scrollbar {
    width: 6px;
}

.aether-nexus-messages::-webkit-scrollbar-track {
    background: rgba(20, 184, 166, 0.1);
    border-radius: 3px;
}

.aether-nexus-messages::-webkit-scrollbar-thumb {
    background: rgba(20, 184, 166, 0.3);
    border-radius: 3px;
}

.aether-nexus-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(20, 184, 166, 0.5);
}

/* Message Bubbles */
.aether-nexus-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    animation: aether-message-in 0.3s ease-out;
}

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

.aether-nexus-message.user {
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    color: white;
    align-self: flex-end;
    margin-left: auto;
}

.aether-nexus-message.agent {
    background: white;
    color: #374151;
    align-self: flex-start;
    border: 1px solid rgba(20, 184, 166, 0.2);
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.1);
}

.aether-nexus-message.system {
    background: rgba(20, 184, 166, 0.1);
    color: #0d9488;
    align-self: center;
    font-size: 12px;
    font-style: italic;
    text-align: center;
}

/* Typing Indicator */
.aether-nexus-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    align-self: flex-start;
    border: 1px solid rgba(20, 184, 166, 0.2);
}

.aether-nexus-typing-dots {
    display: flex;
    gap: 4px;
}

.aether-nexus-typing-dot {
    width: 6px;
    height: 6px;
    background: #14b8a6;
    border-radius: 50%;
    animation: aether-typing 1.4s infinite ease-in-out;
}

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

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

@keyframes aether-typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Chat Input */
.aether-nexus-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid rgba(20, 184, 166, 0.1);
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.aether-nexus-input {
    flex: 1;
    border: 2px solid rgba(20, 184, 166, 0.2);
    border-radius: 20px;
    padding: 12px 16px;
    font-size: 14px;
    resize: none;
    outline: none;
    transition: border-color 0.2s ease;
    font-family: inherit;
    max-height: 100px;
    min-height: 44px;
}

.aether-nexus-input:focus {
    border-color: #14b8a6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

.aether-nexus-input::placeholder {
    color: #9ca3af;
}

.aether-nexus-send {
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.aether-nexus-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

.aether-nexus-send:active {
    transform: scale(0.95);
}

.aether-nexus-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.aether-nexus-send-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Welcome Message */
.aether-nexus-welcome {
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    padding: 40px 20px;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.05), rgba(20, 184, 166, 0.1));
    border-radius: 12px;
    margin: 20px;
}

.aether-nexus-welcome h3 {
    color: #14b8a6;
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 480px) {
    .aether-nexus-chat {
        width: calc(100vw - 40px);
        height: calc(100vh - 100px);
        right: 20px;
        bottom: 80px;
    }
    
    .aether-nexus-container.bottom-left .aether-nexus-chat {
        left: 20px;
        right: auto;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .aether-nexus-chat {
        background: rgba(17, 24, 39, 0.95);
        box-shadow: 
            0 20px 60px rgba(0, 0, 0, 0.3),
            0 0 0 1px rgba(255, 255, 255, 0.1);
    }
    
    .aether-nexus-messages {
        background: linear-gradient(180deg, rgba(20, 184, 166, 0.05), rgba(20, 184, 166, 0.1));
    }
    
    .aether-nexus-message.agent {
        background: rgba(31, 41, 55, 0.8);
        color: #e5e7eb;
        border-color: rgba(20, 184, 166, 0.3);
    }
    
    .aether-nexus-input-container {
        background: rgba(31, 41, 55, 0.8);
        border-top-color: rgba(20, 184, 166, 0.2);
    }
    
    .aether-nexus-input {
        background: rgba(17, 24, 39, 0.8);
        color: #e5e7eb;
        border-color: rgba(20, 184, 166, 0.3);
    }
    
    .aether-nexus-input::placeholder {
        color: #6b7280;
    }
    
    .aether-nexus-welcome {
        background: linear-gradient(135deg, rgba(20, 184, 166, 0.1), rgba(20, 184, 166, 0.15));
        color: #9ca3af;
    }
}

/* Accessibility */
.aether-nexus-bubble:focus,
.aether-nexus-close:focus,
.aether-nexus-send:focus {
    outline: 2px solid #14b8a6;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .aether-nexus-bubble {
        border: 2px solid #14b8a6;
    }
    
    .aether-nexus-message.agent {
        border-width: 2px;
    }
    
    .aether-nexus-input {
        border-width: 3px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .aether-nexus-bubble,
    .aether-nexus-chat,
    .aether-nexus-message,
    .aether-nexus-send {
        animation: none;
        transition: none;
    }
    
    .aether-nexus-bubble::before {
        animation: none;
    }
    
    .aether-nexus-header::before {
        animation: none;
    }
}
