/* ==========================================================================
   Session Input Area
   ========================================================================== */

.session-view-input {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--bg-darker);
    border-top: 1px solid var(--border);
    position: relative;
    flex-shrink: 0;
}

.session-view-input .input-prompt {
    color: var(--accent);
    font-weight: bold;
    font-size: 1.1rem;
    padding-bottom: 0.5rem;
}

.session-view-input .message-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    resize: none;
    min-height: 1.4em;
    max-height: 10em;
    overflow-y: auto;
    line-height: 1.4;
}

.session-view-input .message-input:focus {
    border-color: var(--accent);
}

.session-view-input .message-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.session-view-input .send-button {
    padding: 0.5rem 1.25rem;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    color: var(--bg-dark);
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.session-view-input .send-button:hover:not(:disabled) {
    opacity: 0.9;
}

.session-view-input .send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Send button container with dropdown */
.send-button-container {
    position: relative;
    display: flex;
}

.send-button-container .send-button {
    border-radius: 6px 0 0 6px;
    padding: 0.75rem 1rem;
}

.send-button-container .send-button.wiggum-mode {
    background: linear-gradient(135deg, var(--accent) 0%, #bb9af7 100%);
}

.send-mode-toggle {
    padding: 0.75rem 0.5rem;
    background: var(--accent);
    border: none;
    border-left: 1px solid rgba(0, 0, 0, 0.2);
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    color: var(--bg-dark);
    font-size: 0.7rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.send-mode-toggle:hover:not(:disabled) {
    opacity: 0.9;
}

.send-mode-toggle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.send-mode-dropdown {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 4px;
    background: var(--bg-darker);
    border: 1px solid var(--border);
    border-radius: 6px;
    min-width: 140px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

.send-mode-dropdown.open {
    display: flex;
}

.dropdown-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.6rem 0.8rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.dropdown-option:hover {
    background: rgba(122, 162, 247, 0.15);
}

.dropdown-option.selected {
    background: rgba(122, 162, 247, 0.25);
}

.dropdown-option.wiggum {
    color: #bb9af7;
}

.wiggum-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.wiggum-icon {
    width: 18px;
    height: 18px;
    border-radius: 3px;
}

.dropdown-option .option-hint {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

.dropdown-option.attachment {
    border-top: 1px solid var(--border);
}

/* ==========================================================================
   Voice Input
   ========================================================================== */

.voice-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.voice-button:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}

.voice-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.voice-button.recording {
    /* Background gradient is set via inline style for real-time volume feedback */
    border-color: var(--error);
    color: var(--error);
}

.voice-button svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.voice-button .voice-icon {
    font-size: 16px;
    line-height: 1;
}

/* Voice button unsupported state (browser doesn't have AudioWorklet) */
.voice-button.unsupported {
    opacity: 0.3;
    cursor: not-allowed;
    border-style: dashed;
}

.voice-button.unsupported:hover {
    border-color: var(--border);
    color: var(--text-secondary);
}

/* Interim transcription display during voice recording */
.interim-transcription {
    position: absolute;
    left: 48px;
    right: 100px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 1;
}

.message-input.has-interim {
    color: transparent;
}

.message-input.has-interim::placeholder {
    color: transparent;
}

/* ==========================================================================
   File Upload / Attachment
   ========================================================================== */

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

/* Attachment indicator bar above input */
.attachment-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 1.5rem;
    background: rgba(122, 162, 247, 0.1);
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

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

.attachment-name::before {
    content: "\1f4ce ";
}

.attachment-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0 0.25rem;
    line-height: 1;
}

.attachment-remove:hover {
    color: var(--error);
}

/* Attach button inside send bar */
.attach-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px 0 0 6px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 16px;
    transition: border-color 0.2s, color 0.2s;
}

.attach-button:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
}

.attach-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.attach-button.has-file {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(122, 162, 247, 0.1);
}

.attach-button.uploading {
    pointer-events: none;
    border-color: var(--accent);
    background: conic-gradient(
        var(--accent) calc(var(--upload-progress) * 1deg),
        transparent calc(var(--upload-progress) * 1deg)
    );
    color: var(--bg-dark);
}

/* Upload progress bar — appears above input when files are uploading */
.upload-bar {
    padding: 6px 12px;
    background: var(--bg-dark);
    border-top: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.upload-bar-header {
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 2px;
}

.upload-bar-file {
    padding-left: 8px;
    line-height: 1.4;
}

.upload-bar-track {
    margin-top: 4px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.upload-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.2s ease;
}

/* Drop hint — shown as subtle static label, prominent on drag-hover */
.session-view-input .drop-hint {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.72rem;
    color: var(--text-muted);
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    transition: opacity 0.15s, color 0.15s;
}

.session-view-input.drag-hover .drop-hint {
    opacity: 1;
    color: var(--accent);
}

/* Drag-hover: highlight the input area */
.session-view-input.drag-hover {
    border-top-color: var(--accent);
    background: rgba(122, 162, 247, 0.06);
}

.session-view-input.drag-hover .message-input {
    border-color: var(--accent);
    border-style: dashed;
}

/* Nav mode: dim the input area to indicate it's not active */
.session-views-container.nav-mode .session-view-input {
    opacity: 0.5;
    pointer-events: none;
    border-top: 1px dashed var(--accent);
}

.session-views-container.nav-mode .session-view-input .message-input {
    border-color: var(--accent);
    background: rgba(122, 162, 247, 0.05);
}
