/* === Input Area — Glassmorphic === */

#input-bar {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    background: rgba(10, 15, 30, 0.8) !important;
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
}

/* Textarea — with animated gradient border on focus */
.message-input-container {
    position: relative;
}

#prompt {
    scrollbar-width: none;
    -ms-overflow-style: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    padding: 10px 14px;
    color: #f1f5f9;
    resize: none;
    max-height: 400px;
    transition: border-color 300ms ease, background 300ms ease, box-shadow 300ms ease;
}

#prompt::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

#prompt:focus {
    outline: none;
    border-color: rgba(129, 140, 248, 0.35);
    background: rgba(255, 255, 255, 0.06);
    box-shadow:
        0 0 20px rgba(99, 102, 241, 0.12),
        0 0 40px rgba(99, 102, 241, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#prompt::-webkit-scrollbar {
    display: none;
}

#sendRequest {
    line-height: 3.4rem;
}

/* Send button — subtle indigo gradient pill */
button.send-button.p-2.ml-2.bg-blue-500.hover\:bg-blue-700.text-white.rounded {
    height: 42px;
    width: 42px;
    font-size: 18px;
    margin-right: -8px;
    margin-left: 7px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.5), rgba(129, 140, 248, 0.4)) !important;
    color: rgba(255, 255, 255, 0.85);
    border-radius: 12px;
    border: 1px solid rgba(129, 140, 248, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 250ms ease, box-shadow 250ms ease, background 250ms ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

button.send-button.p-2.ml-2.bg-blue-500.hover\:bg-blue-700.text-white.rounded:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.65), rgba(129, 140, 248, 0.55)) !important;
    transform: scale(1.06);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25);
}

/* Mic badge on send button (hold-to-record indicator) */
.send-btn-mic-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    font-size: 10px !important;
    color: rgba(248, 113, 113, 0.7) !important;
    pointer-events: none;
}

button.send-button {
    position: relative;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

/* Speech-bubble tooltip for hold-to-record (once daily) */
.hold-to-record-tip {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: rgba(99, 102, 241, 0.85);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 8px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 1;
    transition: opacity 400ms ease;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
    animation: tipFadeIn 600ms ease;
}

.hold-to-record-tip::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 14px;
    width: 10px;
    height: 10px;
    background: rgba(99, 102, 241, 0.85);
    transform: rotate(45deg);
    border-radius: 2px;
}

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

.hold-to-record-tip.fading-out {
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 600ms ease, transform 600ms ease;
}

/* AI disclaimer under input */
/* AI disclaimer inside chat area (new chats only, fades out) */
.ai-chat-disclaimer {
    text-align: center;
    font-size: 12px;
    color: rgba(148, 163, 184, 0.35);
    padding: 24px 16px;
    letter-spacing: 0.01em;
    transition: opacity 1s ease;
}

/* Attachment button — original size, indigo hover */
.attachment-button {
    font-size: 22px;
    margin-left: -16px;
    color: rgba(148, 163, 184, 0.45);
    transition: color 250ms ease, filter 250ms ease;
}

.attachment-button:hover {
    background-color: transparent !important;
    color: #818cf8;
    filter: drop-shadow(0 0 8px rgba(129, 140, 248, 0.4));
}

/* Scroll to bottom button — floating glass pill */
#scroll-to-bottom {
    transition: all 0.3s ease;
    background: rgba(99, 102, 241, 0.15) !important;
    border: 1px solid rgba(129, 140, 248, 0.2) !important;
    backdrop-filter: blur(12px);
    color: #a5b4fc !important;
    border-radius: 50% !important;
}

#scroll-to-bottom:hover {
    background: rgba(99, 102, 241, 0.25) !important;
    color: #c7d2fe !important;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25);
    transform: translateY(-2px);
}

/* Attachment message — already glassmorphic, keep as is */
.attachment-message {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12) 0%, rgba(139, 92, 246, 0.08) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
    margin: 4px 0;
}

.attachment-message:hover {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2) 0%, rgba(139, 92, 246, 0.14) 100%);
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.1);
}

.attachment-message span.filename {
    color: #e0eaff;
    font-size: 13px;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    letter-spacing: 0.01em;
}

.attachment-message span.filename::before {
    content: '\f15b';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 8px;
    color: #93c5fd;
    font-size: 12px;
}


/* Transcription dots */
.transcription-dots {
    color: #4CAF50;
    font-weight: bold;
    display: inline-block;
    animation: dots-animation 1.5s infinite;
}

@keyframes dots-animation {
    0% { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
    100% { content: '.'; }
}

.transcription-dots::after {
    content: '.';
    animation: dots-content 1.5s infinite;
}

@keyframes dots-content {
    0% { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
    100% { content: '.'; }
}

/* Drag-over */
textarea#prompt.drag-over {
    background-color: rgba(99, 102, 241, 0.12);
    border-color: rgba(129, 140, 248, 0.4);
    position: relative;
}

textarea#prompt.drag-over::before {
    content: '+';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 5em;
    color: #818cf8;
    pointer-events: none;
    opacity: 0.7;
    z-index: 10;
}

/* Input responsive */
@media (min-width: 1200px) {
    #scroll-to-bottom {
        bottom: 7rem;
        right: 2.5rem;
    }
}

@media (max-width: 1200px) {
    #scroll-to-bottom {
        bottom: 7rem;
        right: 1.5rem;
    }
}
