/* Quick Answer Overlay - MacBook Inspired Design */

.qa-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.qa-overlay.active {
    display: flex;
    opacity: 1;
}

.qa-container {
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    /* Prevent cut-off on small screens */
    background: rgba(20, 20, 25, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.qa-overlay.active .qa-container {
    transform: scale(1) translateY(0);
}

/* Header / Status Bar */
.qa-header {
    padding: 0.5rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.qa-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

.qa-pulsar {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #666;
    transition: all 0.3s ease;
}

/* Status States */
.qa-status[data-state="listening"] .qa-pulsar {
    background: #ff4757;
    /* Red for recording */
    box-shadow: 0 0 10px rgba(255, 71, 87, 0.5);
    animation: pulsar-beat 1.5s infinite;
}

.qa-status[data-state="processing"] .qa-pulsar {
    background: #00ffff;
    /* Cyan for thinking */
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    animation: pulsar-spin 1s infinite linear;
}

.qa-status[data-state="ready"] .qa-pulsar {
    background: #2ecc71;
    /* Green for done */
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.5);
}

.qa-transcript {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.5);
    /* Darker tone */
    padding: 0.8rem 1.2rem 0.2rem;
    min-height: auto;
    font-weight: 500;
    line-height: 1.4;
}

.qa-answer-box {
    padding: 0 1.5rem 1.5rem;
    max-height: 0;
    overflow-y: auto;
    opacity: 0;
    transition: all 0.4s ease;
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
}

.qa-answer-box.visible {
    opacity: 1;
    max-height: 60vh;
    max-height: 60vh;
    padding-top: 0.5rem;
}

/* Markdown Styling within Answer Box */
.qa-answer-box h1,
.qa-answer-box h2,
.qa-answer-box h3 {
    margin-top: 1em;
    margin-bottom: 0.5em;
    font-weight: 600;
    color: #fff;
}

.qa-answer-box p {
    margin-bottom: 0.8em;
}

.qa-answer-box code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 4px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
}

.qa-answer-box strong {
    color: #fff;
    font-weight: 600;
}

/* Footer / Actions */
.qa-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1.2rem;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.qa-actions {
    display: flex;
    gap: 0.4rem;
}

.qa-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.qa-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: translateY(-1px);
}

.qa-btn:active {
    transform: scale(0.96);
}

.qa-btn-close {
    width: 30px;
    height: 30px;
    padding: 0;
    justify-content: center;
    background: transparent;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.4);
}

.qa-btn-close:hover {
    background: rgba(255, 71, 87, 0.1);
    color: #ff4757;
}

/* Animations */
@keyframes pulsar-beat {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulsar-spin {
    0% {
        transform: rotate(0deg);
        border-radius: 2px;
    }

    50% {
        border-radius: 50%;
    }

    100% {
        transform: rotate(180deg);
        border-radius: 2px;
    }
}

/* Scrollbar */
.qa-answer-box::-webkit-scrollbar {
    width: 6px;
}

.qa-answer-box::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.qa-answer-box::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.qa-answer-box::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}