/* ==========================================================================
   AETHER AI CODE STUDIO - CHAT & MESSAGES STYLES
   ========================================================================== */

/* Main Chat Container (Gemini Central Radial Aura Glow) */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 50% 45%, rgba(26, 34, 60, 0.4) 0%, rgba(9, 9, 11, 0.98) 65%);
}

/* Chat Header */
.chat-header {
    height: 56px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(9, 9, 11, 0.6);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.model-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.model-dropdown {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.model-dropdown:hover, .model-dropdown:focus {
    border-color: var(--border-focus);
    background: var(--bg-surface-hover);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Chat Messages Viewport */
.messages-viewport {
    flex: 1;
    overflow-y: auto;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    scroll-behavior: smooth;
}

.messages-list {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Welcome Screen */
.welcome-hero {
    margin: auto 0;
    text-align: center;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: fadeIn 0.4s ease-out;
}

.welcome-logo {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.welcome-title {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #ffffff 50%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.typewriter-sub {
    font-size: 1.2rem;
    font-weight: 500;
    color: #ececec;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 6px 0 10px;
    letter-spacing: -0.01em;
}

.typewriter-cursor {
    color: #ffffff;
    font-weight: 700;
    margin-left: 3px;
    animation: blinkCursor 0.8s infinite;
}

@keyframes blinkCursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.welcome-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Quick Prompt Action Pills */
.prompt-chips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    width: 100%;
    margin-top: 10px;
}

.chip-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 12px 16px;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chip-btn:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.chip-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.chip-sub {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Single Message Element */
.msg-row {
    display: flex;
    gap: 12px;
    width: 100%;
    margin-bottom: 20px;
    box-sizing: border-box;
    animation: fadeInMsg 0.2s ease-out forwards;
}

@keyframes fadeInMsg {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 600;
}

.msg-row.user {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.msg-row.user .msg-avatar {
    background: #27272a;
    color: #f4f4f5;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.msg-row.assistant {
    flex-direction: row;
    justify-content: flex-start;
}

.msg-row.assistant .msg-avatar {
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #38bdf8;
}

.msg-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 85%;
}

.msg-row.user .msg-body {
    align-items: flex-end;
}

.msg-row.assistant .msg-body {
    align-items: flex-start;
}

.msg-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: #71717a;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 0 2px 0 !important;
    outline: none !important;
}

.msg-sender {
    font-weight: 600;
    color: #a1a1aa;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    outline: none !important;
}

.msg-content {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #f4f4f5;
    word-break: break-word;
    word-wrap: break-word;
    width: fit-content;
}

.msg-row.user .msg-content {
    background: #27272a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 10px 16px;
    border-radius: 16px 16px 4px 16px;
    color: #f4f4f5;
    max-width: 100%;
}

.msg-row.assistant .msg-content {
    background: transparent;
    border: none;
    padding: 4px 0;
    border-radius: 0;
    color: #f4f4f5;
    max-width: 100%;
    box-shadow: none;
}

/* Action Buttons Bar (Écouter, Like, Dislike, Copier) */
.msg-actions-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.msg-action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #a1a1aa;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    outline: none;
}

.msg-action-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.msg-action-btn.active {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.4);
}

.msg-action-btn.speaking {
    background: #38bdf8;
    color: #09090b;
    border-color: #38bdf8;
    animation: pulseSpeech 1s infinite alternate;
}

@keyframes pulseSpeech {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Code Blocks Styling */
.code-block-wrapper {
    margin: 14px 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    background: #090b10;
    box-shadow: var(--shadow-sm);
}

.code-header {
    background: #12151e;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.code-lang {
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: lowercase;
    font-weight: 500;
}

.code-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.code-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f4f4f5;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-sans);
    transition: all var(--transition-fast);
}

.code-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

.code-btn.btn-run {
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: #18181b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.code-btn.btn-run:hover {
    background: #27272a;
    border-color: #ffffff;
    color: #ffffff;
}

pre code.hljs {
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    line-height: 1.6;
    background: transparent;
    display: block;
    overflow-x: auto;
}

/* Inline Code */
:not(pre) > code {
    background: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.25);
    padding: 2px 6px;
    border-radius: 5px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

/* Typing Indicator */
.typing-dots {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 0;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--accent-primary);
    border-radius: 50%;
    animation: dotPulse 1.2s infinite ease-in-out;
}

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

@keyframes dotPulse {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Input Area (Bottom Fixed Gemini Capsule) */
.input-section {
    padding: 16px 20px 32px;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 10;
}

.input-box-wrapper.pill-capsule {
    width: 100%;
    max-width: 680px;
    background: #1c1d22;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    padding: 6px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.2s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.input-box-wrapper.pill-capsule:focus-within {
    border-color: rgba(255, 255, 255, 0.25);
    background: #22232a;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.08);
}

.input-pill-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.pill-btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: #a1a1aa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.pill-btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.pill-textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #f4f4f5;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    resize: none;
    max-height: 180px;
    min-height: 24px;
    line-height: 1.5;
    padding: 6px 0;
}

.pill-textarea::placeholder {
    color: #71717a;
}

.pill-controls-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.model-select-dropdown {
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #f4f4f5;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.model-select-dropdown:hover {
    background: #27272a;
    border-color: #38bdf8;
    color: #ffffff;
}

.model-select-dropdown optgroup {
    background: #18181b;
    color: #38bdf8;
    font-weight: 700;
}

.model-select-dropdown option {
    background: #18181b;
    color: #f4f4f5;
    font-weight: 400;
    padding: 6px;
}

.mini-model-dropdown {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e4e4e7;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.78rem;
    font-weight: 500;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mini-model-dropdown option {
    background: #18181b;
    color: #f4f4f5;
    padding: 6px 10px;
}

.mini-model-dropdown:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

.mic-btn.recording {
    color: #ef4444;
    animation: pulseMic 1.2s infinite;
}

@keyframes pulseMic {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.pill-send-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ffffff;
    color: #09090b;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pill-send-btn:hover:not(:disabled) {
    background: #e4e4e7;
}

.send-button {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--accent-primary);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.send-button:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: not-allowed;
}

.send-button:not(:disabled):hover {
    background: var(--accent-primary-hover);
    transform: scale(1.05);
}

/* Attachment Previews Area */
.attachments-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 4px;
}

.attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f4f4f5;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-family: var(--font-mono);
    max-width: 240px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.attachment-chip img {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: cover;
}

.attachment-chip-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.attachment-chip-remove {
    background: transparent;
    border: none;
    color: #71717a;
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.attachment-chip-remove:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.2);
}

/* Solid Ultra-Vivid Electric Blue Selection Marker (Chrome Standard Compatible) */
::selection {
    background-color: #2563eb !important;
    color: #ffffff !important;
}

::-moz-selection {
    background-color: #2563eb !important;
    color: #ffffff !important;
}

/* Floating Water Wave Selection Tooltip */
.selection-tooltip {
    position: fixed;
    z-index: 99999;
    background: rgba(18, 18, 21, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 20px;
    padding: 6px 14px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 15px rgba(56, 189, 248, 0.25);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 500;
    color: #f4f4f5;
    cursor: pointer;
    animation: liquidFloat 3s ease-in-out infinite alternate, tooltipPop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    user-select: none;
}

@keyframes liquidFloat {
    0% {
        transform: translateY(0px) scale(1);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 12px rgba(56, 189, 248, 0.2);
        border-color: rgba(56, 189, 248, 0.35);
    }
    50% {
        transform: translateY(-4px) scale(1.02);
        box-shadow: 0 14px 30px rgba(0, 0, 0, 0.7), 0 0 22px rgba(129, 140, 248, 0.4);
        border-color: rgba(129, 140, 248, 0.5);
    }
    100% {
        transform: translateY(0px) scale(1);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 12px rgba(56, 189, 248, 0.2);
        border-color: rgba(56, 189, 248, 0.35);
    }
}

@keyframes tooltipPop {
    0% { opacity: 0; transform: scale(0.85) translateY(10px); }
    100% { opacity: 1; }
}

.selection-tooltip:hover {
    background: rgba(24, 24, 27, 0.95);
    border-color: #38bdf8;
    color: #ffffff;
}
