.input-area-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.input-wrapper {
    width: 100%;
    background-color: var(--bg-input);
    /* Match Media Creator */
    border-radius: 26px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid var(--border-color);
    /* Match Media Creator */
    transition: border-color 0.2s, box-shadow 0.2s;
    min-height: auto;
    /* Auto to allow expansion */
}

.input-wrapper:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px var(--bg-nav-item-active);
}

.input-wrapper.blocked {
    opacity: 0.7;
    pointer-events: none;
    border-color: var(--text-secondary);
}

.input-wrapper.blocked textarea {
    cursor: not-allowed;
}

.input-wrapper.blocked textarea::placeholder {
    color: var(--accent-color);
    font-style: italic;
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.input-actions-left,
.input-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-input {
    width: 100%;
    flex: 0 0 auto;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.5;
    padding: 8px 0;
    resize: none;
    min-height: 48px;
    max-height: 150px; /* ~5-6 lines */
    overflow-y: auto;
    font-family: inherit;
}

.chat-input:focus {
    outline: none;
}

/* Buttons */
.icon-btn,
.tools-btn,
.memory-toggle-btn,
.send-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    border-radius: 50%;
    /* Default circular */
}

.icon-btn {
    width: 36px;
    height: 36px;
}

.icon-btn:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
}

/* Plus Button */
.plus-btn {
    background-color: var(--bg-surface-hover);
    /* Slightly lighter */
    color: var(--text-primary);
}

/* Tools Button */
.tools-btn {
    border-radius: 20px;
    /* Pill shape */
    padding: 6px 12px;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

.tools-btn:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
}

/* Memory Toggle Button */
.memory-toggle-btn {
    border-radius: 20px;
    padding: 6px 12px;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

.memory-toggle-btn:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
}

.memory-toggle-btn.active {
    background-color: rgba(34, 197, 94, 0.15) !important;
    color: #22c55e !important;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.memory-toggle-btn.active svg {
    stroke: #22c55e;
}

/* Send Button */
.send-btn {
    width: 36px;
    height: 36px;
    background-color: transparent;
    color: var(--text-secondary);
    opacity: 0.5;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn svg {
    width: 18px;
    height: 18px;
}

.send-btn.active {
    background-color: var(--text-primary);
    /* White/Black circle */
    color: var(--bg-body);
    /* Inverted icon */
    opacity: 1;
    pointer-events: auto;
}

/* Send button blocked (another user processing) */
.send-btn.send-blocked {
    background-color: rgba(243, 123, 32, 0.3) !important;
    color: var(--text-muted) !important;
    opacity: 0.6 !important;
    pointer-events: none !important;
    cursor: not-allowed;
}

.send-btn.send-blocked svg {
    opacity: 0.5;
}

/* Visual hint on wrapper when send is blocked */
.input-wrapper.send-blocked {
    border-color: rgba(243, 123, 32, 0.4);
}

/* Tooltip showing why send is blocked */
.send-blocked-tooltip {
    position: absolute;
    bottom: 100%;
    right: 8px;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: rgba(243, 123, 32, 0.95);
    color: white;
    font-size: 0.8rem;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.send-blocked-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 16px;
    border: 6px solid transparent;
    border-top-color: rgba(243, 123, 32, 0.95);
}

/* Show tooltip on hover over send button or wrapper */
.input-wrapper.send-blocked:hover .send-blocked-tooltip,
.send-btn.send-blocked:hover + .send-blocked-tooltip {
    opacity: 1;
    transform: translateY(0);
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.btn-label {
    font-size: 0.9rem;
    margin-left: 4px;
    color: var(--text-secondary);
}

/* Model Selector */
.model-selector-container {
    position: relative;
}

.model-selector-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    background: transparent;
    border: none;
    transition: background-color 0.2s;
}

.model-selector-btn:hover {
    background-color: var(--bg-surface-transparent);
    color: var(--text-primary);
}

/* Model Dropdown - moved to dropdowns.css */

/* File Previews */
.file-previews {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    margin-top: 0;
    flex-wrap: wrap;
    width: 100%;
    /* Ensure it takes full width */
    justify-content: flex-start;
    /* Align items to start */
}

.file-previews.hidden {
    display: none;
}

.file-preview-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.file-preview-thumb {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 4px;
}

.file-preview-icon {
    font-size: 24px;
    line-height: 1;
}

.file-preview-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-remove-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.2s;
}

.file-remove-btn:hover {
    color: var(--text-primary);
}

.model-dropdown.hidden {
    display: none;
}

.model-option {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.model-option:hover {
    background-color: var(--bg-surface-transparent);
}

.model-option.active {
    background-color: var(--bg-nav-item-active);
    /* Kinguin Orange tint */
    color: var(--accent-color);
}

.model-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.model-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.chevron {
    font-size: 0.7rem;
}




.disclaimer {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--space-sm);
    text-align: center;
    padding: 0 var(--space-md);
}

/* Microphone Button States */
.mic-btn {
    transition: all 0.2s ease;
}

.mic-btn.recording {
    background-color: #ef4444 !important;
    color: white !important;
    animation: pulse-recording 1.5s ease-in-out infinite;
}

.mic-btn.recording svg {
    stroke: white;
}

.mic-btn.processing {
    background-color: var(--accent-color) !important;
    color: white !important;
    animation: spin 1s linear infinite;
}

.mic-btn.processing svg {
    stroke: white;
}

@keyframes pulse-recording {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Grounding Button (Web Search) */
.grounding-btn {
    transition: all 0.2s ease;
}

.grounding-btn.active {
    background-color: rgba(34, 197, 94, 0.15) !important;
    color: #22c55e !important;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.grounding-btn.active svg {
    stroke: #22c55e;
}

.grounding-btn:hover:not(.disabled) {
    background-color: var(--bg-surface-hover);
}

.grounding-btn.disabled {
    cursor: not-allowed;
    opacity: 0.3;
}

.grounding-btn.disabled:hover {
    background-color: transparent;
}

/* Datastore Button */
.datastore-btn {
    transition: all 0.2s ease;
}

.datastore-btn.active {
    background-color: rgba(243, 123, 32, 0.15) !important;
    color: var(--accent-color) !important;
    border: 1px solid rgba(243, 123, 32, 0.3);
}

.datastore-btn.active svg {
    stroke: var(--accent-color);
}

.datastore-btn:hover {
    background-color: var(--bg-surface-hover);
}

.datastore-btn.hidden {
    display: none;
}

.grounding-btn.hidden {
    display: none;
}