/**
 * ARIA - AI Research Intelligence Assistant
 * Styles for Floating AI Assistant Widget
 * Ultra-Premium Design System
 */

/* ============================================
   Widget Container
   ============================================ */

.aria-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: var(--font-body, 'Inter', sans-serif);
}

/* ============================================
   Floating Action Button
   ============================================ */

.aria-fab {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d4ff 0%, #8b5cf6 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 4px 20px rgba(0, 212, 255, 0.4),
        0 8px 40px rgba(139, 92, 246, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
}

.aria-fab:hover {
    transform: scale(1.08);
    box-shadow:
        0 6px 30px rgba(0, 212, 255, 0.5),
        0 12px 50px rgba(139, 92, 246, 0.4);
}

.aria-fab-icon {
    color: #0a0a0f;
    z-index: 2;
}

.aria-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d4ff 0%, #8b5cf6 100%);
    animation: ariaPulse 2s ease-out infinite;
    z-index: 1;
}

@keyframes ariaPulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* Hide FAB when panel is open */
.aria-widget.aria-open .aria-fab {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

/* ============================================
   Chat Panel
   ============================================ */

.aria-panel {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-height: 560px;
    background: rgba(18, 18, 26, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(0, 212, 255, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: bottom right;
}

.aria-widget.aria-open .aria-panel {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* ============================================
   Panel Header
   ============================================ */

.aria-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.aria-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #00d4ff 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0a0a0f;
}

.aria-title {
    flex: 1;
}

.aria-name {
    display: block;
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    letter-spacing: 0.03em;
}

.aria-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.aria-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.aria-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.aria-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* ============================================
   Messages Area
   ============================================ */

.aria-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 320px;
}

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

.aria-messages::-webkit-scrollbar-track {
    background: transparent;
}

.aria-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.aria-message {
    display: flex;
    max-width: 85%;
}

.aria-message.aria-user {
    align-self: flex-end;
}

.aria-message.aria-bot {
    align-self: flex-start;
}

.aria-message-content {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
}

.aria-message.aria-user .aria-message-content {
    background: linear-gradient(135deg, #00d4ff 0%, #8b5cf6 100%);
    color: #0a0a0f;
    border-bottom-right-radius: 4px;
}

.aria-message.aria-bot .aria-message-content {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    border-bottom-left-radius: 4px;
}

.aria-message-content ul {
    margin: 10px 0 0 0;
    padding-left: 0;
    list-style: none;
}

.aria-message-content li {
    padding: 4px 0;
}

/* Typing Indicator */
.aria-typing {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.aria-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    animation: typingDot 1.4s ease-in-out infinite;
}

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

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

@keyframes typingDot {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-6px);
    }
}

/* ============================================
   Quick Suggestions
   ============================================ */

.aria-suggestions {
    display: flex;
    gap: 8px;
    padding: 0 20px 12px;
    flex-wrap: wrap;
}

.aria-suggestion {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.aria-suggestion:hover {
    background: rgba(0, 212, 255, 0.15);
    border-color: rgba(0, 212, 255, 0.3);
    color: #00d4ff;
}

/* ============================================
   Input Area
   ============================================ */

.aria-input-area {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.aria-input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.aria-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.aria-input:focus {
    border-color: rgba(0, 212, 255, 0.5);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.aria-send {
    width: 44px;
    height: 44px;
    border: none;
    background: linear-gradient(135deg, #00d4ff 0%, #8b5cf6 100%);
    border-radius: 12px;
    color: #0a0a0f;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.aria-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.4);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 480px) {
    .aria-widget {
        bottom: 16px;
        right: 16px;
    }

    .aria-fab {
        width: 56px;
        height: 56px;
    }

    .aria-panel {
        width: calc(100vw - 32px);
        right: -8px;
        bottom: 72px;
        max-height: 70vh;
    }
}

/* ============================================
   Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {

    .aria-pulse,
    .aria-typing span,
    .aria-status-dot {
        animation: none;
    }

    /* ============================================
   Citation Cards (Agentic Output)
   ============================================ */

    .aria-citation-card {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        padding: 12px;
        margin-top: 8px;
        margin-bottom: 8px;
        transition: all 0.2s ease;
    }

    .aria-citation-card:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: rgba(0, 212, 255, 0.3);
    }

    .aria-citation-title {
        font-weight: 600;
        font-size: 13px;
        color: #fff;
        margin-bottom: 4px;
        line-height: 1.4;
        display: block;
        text-decoration: none;
    }

    .aria-citation-title:hover {
        color: #00d4ff;
        text-decoration: underline;
    }

    .aria-citation-author {
        font-size: 11px;
        color: rgba(255, 255, 255, 0.6);
        margin-bottom: 6px;
        display: block;
    }

    .aria-citation-meta {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 10px;
        color: rgba(255, 255, 255, 0.4);
    }

    .aria-citation-badge {
        background: rgba(0, 212, 255, 0.1);
        color: #00d4ff;
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 9px;
        font-weight: 600;
        text-transform: uppercase;
    }