/**
 * ═══════════════════════════════════════════════════════════════
 * VYOMA AI — File & Image Upload Styles v2.0 (file-upload.css)
 * ─────────────────────────────────────────────────────────────
 * ChatGPT-style image bubbles, PDF bubbles, lightbox, analyzing
 * animation, and typing cursor. Fully isolated.
 * ═══════════════════════════════════════════════════════════════
 */

/* ═══════════════════════════════════════════════════════════════
   UPLOAD BUTTONS — Inside input-wrapper
   ═══════════════════════════════════════════════════════════════ */

.akira-upload-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s var(--ease);
    flex-shrink: 0;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.akira-upload-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.2s var(--ease);
}

.akira-upload-btn svg {
    width: 16px;
    height: 16px;
    position: relative;
    z-index: 1;
    transition: all 0.2s var(--ease);
}

.akira-upload-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

.akira-upload-btn:hover svg {
    color: var(--accent);
}

.akira-upload-btn:active {
    transform: scale(0.95);
}

.akira-upload-btn.disabled {
    opacity: 0.35;
    pointer-events: none;
    cursor: not-allowed;
}

/* Image button accent color */
.akira-image-btn:hover {
    border-color: #8b5cf6;
    color: #8b5cf6;
    background: rgba(139, 92, 246, 0.08);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.15);
}

.akira-image-btn:hover svg {
    color: #8b5cf6;
}

/* ═══════════════════════════════════════════════════════════════
   UPLOAD PREVIEW BAR
   ═══════════════════════════════════════════════════════════════ */

.akira-upload-preview {
    max-width: 800px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 14px;
    margin-bottom: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-md);
    animation: akiraSlideUp 0.25s var(--ease);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
}

.akira-upload-preview.hidden {
    display: none;
}

.akira-preview-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.akira-preview-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.akira-preview-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.akira-preview-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.akira-preview-size {
    font-size: 0.72rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.akira-preview-remove {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.72rem;
    transition: all 0.15s var(--ease);
    flex-shrink: 0;
}

.akira-preview-remove:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

/* ═══════════════════════════════════════════════════════════════
   CHATGPT-STYLE IMAGE BUBBLE
   ═══════════════════════════════════════════════════════════════ */

.akira-image-bubble {
    position: relative;
    display: inline-block;
    max-width: 280px;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 6px;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
    transition: all 0.2s var(--ease);
}

.akira-image-bubble:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.akira-chat-image {
    width: 100%;
    max-width: 280px;
    min-width: 120px;
    display: block;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s var(--ease);
}

.akira-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.4) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.2s var(--ease);
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 8px;
    border-radius: 12px;
}

.akira-image-bubble:hover .akira-image-overlay {
    opacity: 1;
}

.akira-image-expand {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s var(--ease);
}

.akira-image-expand:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* ═══════════════════════════════════════════════════════════════
   CHATGPT-STYLE FILE / PDF BUBBLE
   ═══════════════════════════════════════════════════════════════ */

.akira-file-bubble {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-top: 6px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    max-width: 280px;
    transition: all 0.2s var(--ease);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.akira-file-bubble:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.akira-file-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    border-radius: 10px;
}

.akira-file-info {
    min-width: 0;
    flex: 1;
}

.akira-file-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.akira-file-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   LIGHTBOX — Click-to-expand image viewer
   ═══════════════════════════════════════════════════════════════ */

.akira-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: akiraFadeIn 0.2s var(--ease);
}

.akira-lightbox.hidden {
    display: none;
}

.akira-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.akira-lightbox-content {
    position: relative;
    z-index: 1;
    max-width: 90vw;
    max-height: 90vh;
    animation: akiraScaleIn 0.25s var(--ease);
}

.akira-lightbox-content img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    object-fit: contain;
}

.akira-lightbox-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s var(--ease);
}

.akira-lightbox-close:hover {
    background: rgba(239, 68, 68, 0.6);
    transform: scale(1.1);
}

/* ═══════════════════════════════════════════════════════════════
   "Analyzing…" Animation Bubble
   ═══════════════════════════════════════════════════════════════ */

.akira-analyzing-content {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.akira-analyzing-icon {
    font-size: 1.1rem;
    animation: akiraPulse 1.5s ease-in-out infinite;
}

.akira-analyzing-text {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.88rem;
}

.akira-analyzing-dots {
    display: inline-flex;
    gap: 3px;
    align-items: center;
}

.akira-analyzing-dots span {
    width: 5px;
    height: 5px;
    background: var(--accent);
    border-radius: 50%;
    display: inline-block;
    animation: akiraAnalyzeDot 1.4s ease-in-out infinite;
}

.akira-analyzing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.akira-analyzing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

.akira-analyzing-bubble {
    animation: akiraFadeIn 0.3s var(--ease);
}

.akira-fade-out {
    animation: akiraFadeOut 0.2s var(--ease) forwards;
}

/* ═══════════════════════════════════════════════════════════════
   Typing Cursor
   ═══════════════════════════════════════════════════════════════ */

.akira-typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1.1em;
    background: var(--accent);
    margin-left: 1px;
    vertical-align: text-bottom;
    animation: akiraTypingBlink 0.7s step-end infinite;
    border-radius: 1px;
}

.akira-typing-target {
    min-height: 1.4em;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */

@keyframes akiraSlideUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes akiraFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes akiraFadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-5px);
    }
}

@keyframes akiraScaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes akiraPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.15);
        opacity: 0.7;
    }
}

@keyframes akiraAnalyzeDot {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.3;
    }

    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

@keyframes akiraTypingBlink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .akira-upload-btn {
        width: 30px;
        height: 30px;
    }

    .akira-upload-btn svg {
        width: 14px;
        height: 14px;
    }

    .akira-upload-preview {
        padding: 6px 12px;
        margin-bottom: 6px;
    }

    .akira-preview-name {
        font-size: 0.78rem;
    }

    .akira-image-bubble,
    .akira-chat-image {
        max-width: 220px;
    }

    .akira-file-bubble {
        max-width: 240px;
    }

    .akira-lightbox-content img {
        max-width: 95vw;
        max-height: 80vh;
    }
}

@media (max-width: 480px) {
    .akira-upload-btn {
        width: 28px;
        height: 28px;
    }

    .akira-upload-btn svg {
        width: 13px;
        height: 13px;
    }

    .akira-image-bubble,
    .akira-chat-image {
        max-width: 180px;
    }

    .akira-file-bubble {
        max-width: 200px;
        padding: 10px 12px;
    }

    .akira-file-icon {
        width: 36px;
        height: 36px;
        font-size: 1.4rem;
    }
}