/* Aetheria 2.0 System Framework: Communication Layer & Transcripts */

.chat-area {
    flex-grow: 1;
    display: flex; flex-direction: column;
    background: rgba(255, 255, 255, 0.01);
}

/* -- UPPER BAR -- */
.chat-header {
    height: var(--header-height);
    padding: 0 40px;
    border-bottom: 1px solid var(--border-glass);
    display: flex; justify-content: space-between; align-items: center;
    box-sizing: border-box;
    flex-shrink: 0; /* GUARANTEES EXACT HEIGHT LOCK */
}
.header-info h2 {
    font-weight: 700; font-size: 1.25rem; margin-bottom: 4px;
}
.status-badge {
    font-size: 0.75rem; background: rgba(108, 92, 231, 0.15);
    color: var(--text-secondary); padding: 4px 10px; border-radius: 20px;
}

/* -- MESSAGE SCROLLZONE -- */
.chat-messages {
    flex-grow: 1; padding: 40px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 24px;
}
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }

.message { display: flex; gap: 16px; max-width: 75%; }
.message.user { align-self: flex-end; flex-direction: row-reverse; }
.message.system { max-width: 100%; width: 100%; justify-content: center; align-self: center; margin: 4px 0; }

.avatar {
    width: 40px; height: 40px; background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-glass); border-radius: 12px;
    display: flex; justify-content: center; align-items: center; font-size: 1.1rem;
}

.message-content {
    background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-glass);
    border-radius: 18px; padding: 16px 20px; line-height: 1.5; font-size: 0.95rem;
}
.message.user .message-content {
    background: var(--accent); color: #fff; border: none;
}

/* -- INPUT STATION -- */
.chat-input-container {
    padding: 24px 40px 32px 40px;
}
.input-wrapper {
    background: var(--input-bg); border: 1px solid var(--border-glass);
    border-radius: 18px; display: flex; align-items: center; padding: 8px 16px;
}
.input-wrapper textarea {
    flex: 1; background: transparent; border: none; outline: none;
    color: var(--text-primary); font-size: 1rem; resize: none;
    overflow-y: auto; height: 24px; min-height: 24px; max-height: 200px;
    padding: 2px 0; font-family: inherit; line-height: 1.5;
}

.btn-voice, .btn-send {
    background: transparent; border: none; font-size: 1.2rem;
    cursor: pointer; padding: 10px; transition: all 0.2s ease;
}
.btn-voice:hover { transform: scale(1.15); }
.btn-send:hover { transform: translate(2px, -2px); }

/* -- ACTIVE PLAYBACK FLOAT -- */
#activeAudioToolbar {
    display: flex; align-items: center; justify-content: center;
    background: rgba(15, 15, 25, 0.9); backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1); padding: 10px 20px;
    border-radius: 40px; position: absolute; bottom: 90px; left: 50%;
    transform: translateX(-50%) translateY(30px); opacity: 0;
    pointer-events: none; visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999; gap: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    width: auto; white-space: nowrap; min-width: 260px; 
}
#activeAudioToolbar.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1; pointer-events: auto; visibility: visible;
}
.audio-toolbar-btn {
    background: rgba(255, 50, 50, 0.25); color: #ff6b6b;
    border: 1px solid rgba(255, 50, 50, 0.3); padding: 6px 18px;
    border-radius: 25px; font-size: 0.8rem; font-weight: 700;
    cursor: pointer; display: flex; align-items: center; gap: 6px;
    transition: all 0.2s;
}
.audio-toolbar-btn:hover { background: rgba(255, 50, 50, 0.4); transform: scale(1.05); }

/* --- ULTIMATE HYBRID ZERO-BLEED SELECTOR --- */
.intent-box {
    position: relative;
    width: 52px;
    min-width: 52px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    margin-right: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.intent-box:hover {
    background: rgba(108, 92, 231, 0.12);
    border-color: rgba(108, 92, 231, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}
.intent-box:active { transform: translateY(0) scale(0.95); }

.intent-visual {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.25rem;
    pointer-events: none; /* Clicks pass right through it */
    z-index: 1;
    display: block;
    line-height: 1;
}

.intent-native {
    position: relative; /* 🛡️ PREVENTS "FLOATING NEAR ADRESS BAR" - STAYS IN NORMAL LAYOUT FLOW */
    width: 100%;
    height: 100%;
    opacity: 0; /* 🕵️‍♀️ COMPLETELY INVISIBLE TO THE EYE */
    z-index: 2; /* 👆 RESTS ON TOP SO IT CATCHES THE CLICK */
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    color-scheme: dark;
}

/* 🌟 GUARANTEE DROP-DOWN ITEMS ARE FULLY RENDERED & READABLE */
.intent-native option {
    background-color: #131524;
    color: #f5f6fa;
    font-size: 1rem !important;
    padding: 14px;
    font-family: var(--font-main);
    opacity: 1;
}

/* 💎 Aetheria Brand Visual Assets */
.brand img.logo-icon {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.brand:hover img.logo-icon {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 0 12px rgba(162, 155, 254, 0.8));
}

@keyframes logo-float {
    0% { transform: translateY(0px) scale(1); filter: drop-shadow(0 0 15px rgba(162, 155, 254, 0.5)); }
    50% { transform: translateY(-6px) scale(1.03); filter: drop-shadow(0 0 25px rgba(162, 155, 254, 0.8)); }
    100% { transform: translateY(0px) scale(1); filter: drop-shadow(0 0 15px rgba(162, 155, 254, 0.5)); }
}

/* --- VISION MODE: IMAGE PREVIEW --- */
.image-preview-container {
    display: none;
    padding: 12px 40px;
    gap: 12px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border-glass);
    animation: fadeIn 0.3s ease;
}
.image-preview-item {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--accent);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.image-preview-remove {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.65rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
