/**
 * apps/bme/css/pages/ai-multimodal.css
 * Sleek Glassmorphism & High-End Motion Styles for Multimodal BME AI Integration
 */

/* ============================================
   MULTIMODAL FILE CONTEXT TAGS
   ============================================ */
.ai-file-context-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 4px;
    width: 100%;
}

.file-context-tag {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
    position: relative;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    animation: tag-pop-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 100%;
    box-sizing: border-box;
}

[data-theme="dark"] .file-context-tag {
    background: rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.08);
}

.file-context-tag:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.file-tag-thumbnail {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.file-tag-icon-wrap {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(245, 166, 35, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.file-tag-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.file-tag-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 130px;
}

.file-tag-meta {
    font-size: 0.62rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1px;
}

.btn-remove-tag {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-main);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.6rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-remove-tag:hover {
    background: #ff4d4f;
    border-color: #ff4d4f;
    color: white;
    transform: scale(1.1);
}

@keyframes tag-pop-in {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ============================================
   AI GESTURE RADIAL MENU OVERLAY
   ============================================ */
.ai-radial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: transparent; /* No overlay brightness reduction as requested */
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 999; /* Positioned below tab-nav (1000) so tab-nav remains unblurred and at full brightness */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-radial-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.radial-center-anchor {
    position: absolute;
    width: 0;
    height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.radial-ring-menu {
    position: absolute;
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.radial-action-btn {
    position: absolute;
    width: 62px;
    height: 62px;
    border-radius: 50% !important;
    color: #444444 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--bg-card) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25) !important;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: transform, opacity, filter;
    box-sizing: border-box;

    /* Animated Mesh Gradient Styles identical to tab-btn-ai */
    --c-0: hsla(190, 100%, 88%, 0.66);
    --y-0: 11%;
    --x-0: 91%;
    --c-1: hsla(136, 100%, 88%, 1);
    --x-1: 69.11764778558965%;
    --y-1: 54.30547154879501%;
    --c-2: hsla(280, 64%, 64%, 1);
    --y-2: 87%;
    --x-2: 36%;
    background-color: hsla(0, 0%, 100%, 0.77) !important;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 623 623' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E"), radial-gradient(circle at var(--x-0) var(--y-0), var(--c-0) var(--s-start-0), transparent var(--s-end-0)), radial-gradient(circle at var(--x-1) var(--y-1), var(--c-1) var(--s-start-1), transparent var(--s-end-1)), radial-gradient(circle at var(--x-2) var(--y-2), var(--c-2) var(--s-start-2), transparent var(--s-end-2)) !important;
    animation: ani-tab-btn-ai 4s linear infinite alternate; /* Slower mesh animation */
    background-blend-mode: overlay, normal, normal, normal;
    contain: paint;
}

.radial-action-btn i-ui {
    color: #444444 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: color 0.25s;
}

/* Camera: 11 o'clock — further out */
.radial-action-btn.btn-camera {
    transform: translate(-76px, -76px) scale(1.0);
}

/* Gallery: 12 o'clock — top center, further out and higher */
.radial-action-btn.btn-gallery {
    transform: translate(0px, -98px) scale(1.0);
}

/* Mic: 1 o'clock — further out */
.radial-action-btn.btn-mic {
    transform: translate(76px, -76px) scale(1.0);
}

/* Enlarge active button */
.radial-action-btn.btn-camera.active,
.radial-action-btn.btn-camera:hover {
    transform: translate(-76px, -76px) scale(1.18);
    box-shadow: 0 0 20px rgba(245, 166, 35, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3) !important;
}

.radial-action-btn.btn-gallery.active,
.radial-action-btn.btn-gallery:hover {
    transform: translate(0px, -98px) scale(1.18);
    box-shadow: 0 0 20px rgba(245, 166, 35, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3) !important;
}

.radial-action-btn.btn-mic.active,
.radial-action-btn.btn-mic:hover {
    transform: translate(76px, -76px) scale(1.18);
    box-shadow: 0 0 20px rgba(245, 166, 35, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3) !important;
}

/* Fade out the non-active sibling buttons dramatically when one is hovered/active */
.radial-ring-menu:has(.btn-mic.active) .btn-camera,
.radial-ring-menu:has(.btn-gallery.active) .btn-camera {
    opacity: 0.35;
    filter: brightness(0.7) saturate(0.6);
    transform: translate(-76px, -76px) scale(0.85);
}

.radial-ring-menu:has(.btn-mic.active) .btn-gallery,
.radial-ring-menu:has(.btn-camera.active) .btn-gallery {
    opacity: 0.35;
    filter: brightness(0.7) saturate(0.6);
    transform: translate(0px, -98px) scale(0.85);
}

.radial-ring-menu:has(.btn-camera.active) .btn-mic,
.radial-ring-menu:has(.btn-gallery.active) .btn-mic {
    opacity: 0.35;
    filter: brightness(0.7) saturate(0.6);
    transform: translate(76px, -76px) scale(0.85);
}

/* ============================================
   MIC RECORDING STATE HIGHLIGHTS
   ============================================ */
#btn-ai-mic.recording {
    background: #ff4d4f !important;
    border-color: #ff4d4f !important;
    color: white !important;
    animation: active-recording-pulse 1s infinite alternate !important;
}

.radial-action-btn.btn-mic.recording {
    background: #ff4d4f !important;
    border-color: #ff4d4f !important;
    color: white !important;
    animation: radial-mic-recording-pulse 1s infinite alternate !important;
}

.radial-action-btn.btn-mic.recording.active {
    background: #ff4d4f !important;
    border-color: #ff4d4f !important;
    color: white !important;
    animation: radial-mic-active-recording-pulse 1s infinite alternate !important;
}

.radial-action-btn.recording i-ui,
#btn-ai-mic.recording i-ui {
    color: white !important;
}

@keyframes active-recording-pulse {
    0% {
        box-shadow: 0 0 10px rgba(255, 77, 79, 0.5);
        transform: scale(0.96);
    }
    100% {
        box-shadow: 0 0 25px rgba(255, 77, 79, 0.9);
        transform: scale(1.06);
    }
}

@keyframes radial-mic-recording-pulse {
    0% {
        box-shadow: 0 0 10px rgba(255, 77, 79, 0.5);
        transform: translate(55px, -55px) scale(0.96);
    }
    100% {
        box-shadow: 0 0 25px rgba(255, 77, 79, 0.9);
        transform: translate(55px, -55px) scale(1.06);
    }
}

@keyframes radial-mic-active-recording-pulse {
    0% {
        box-shadow: 0 0 15px rgba(255, 77, 79, 0.6);
        transform: translate(55px, -55px) scale(1.18);
    }
    100% {
        box-shadow: 0 0 30px rgba(255, 77, 79, 0.95);
        transform: translate(55px, -55px) scale(1.3);
    }
}

/* ============================================
   FILE PREVIEW MODAL
   ============================================ */
.file-preview-modal {
    display: none;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
}

.file-preview-modal.active {
    display: flex !important;
}
