.chat-input-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 12px;
    z-index: 50;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@supports not (backdrop-filter: blur(20px)) {
    .chat-input-container {
        background: rgba(255, 255, 255, 0.98);
    }
}

/* VoiceRecorder Component Support */
.chat-input-container .voice-recorder-container {
    flex: 1;
    min-width: 0;
    width: 100%;
}

.chat-input-container .voice-recorder-container .input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.chat-input-container .voice-recorder-container .message-input {
    flex: 1;
    padding: 12px 20px;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
    background: #f5f5f5;
    font-family: 'MainFont', Arial, sans-serif;
    min-height: 44px;
    box-sizing: border-box;
}

.chat-input-container .voice-recorder-container .message-input:focus {
    border-color: #1976D2;
    background: white;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

.chat-input-container .voice-recorder-container .action-btn {
    flex-shrink: 0;
    transition: all 0.2s ease;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    outline: none;
}

.chat-input-container .voice-recorder-container .action-btn:active {
    transform: scale(0.95);
}

.chat-input-container .voice-recorder-container .action-btn i {
    font-size: 24px;
}

.chat-input-container .voice-recorder-container .mic-btn {
    background-color: #1976D2 !important;
    color: white !important;
}

.chat-input-container .voice-recorder-container .mic-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

.chat-input-container .voice-recorder-container .mic-btn:active {
    transform: scale(0.95);
}

.chat-input-container .voice-recorder-container .send-btn {
    background-color: #1976D2 !important;
    color: white !important;
    transform: rotate(180deg);
}

.chat-input-container .voice-recorder-container .send-btn:hover {
    transform: rotate(180deg) scale(1.05);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

.chat-input-container .voice-recorder-container .send-btn:active {
    transform: rotate(180deg) scale(0.95);
}

/* Direction and Alignment Override */
.chat-input-container .voice-recorder-container .message-input[style*="direction: ltr"] {
    text-align: left !important;
    direction: ltr !important;
}

.chat-input-container .voice-recorder-container .message-input[style*="direction: rtl"] {
    text-align: right !important;
    direction: rtl !important;
}

.chat-input-container .reply-preview {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 10px 14px;
    margin: 0 4px 12px 4px;
    border-radius: 16px;
    border-right: 4px solid #1976D2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    animation: slideUp 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

.chat-input-container .reply-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(25, 118, 210, 0.05) 100%);
    pointer-events: none;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.chat-input-container .reply-preview .d-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.chat-input-container .reply-preview span {
    color: #1976D2;
    font-weight: 600;
    font-size: 0.8125rem;
    letter-spacing: 0.3px;
}

.chat-input-container .reply-preview .text-truncate {
    color: #495057;
    font-size: 0.875rem;
    margin-top: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 85%;
}

.chat-input-container .reply-preview .v-btn {
    background: rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.chat-input-container .reply-preview .v-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    transform: rotate(90deg);
}

.chat-input-container .d-flex.align-center {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 2px;
    width: 100%;
}

.chat-input-container .voice-recorder-container .d-flex {
    width: 100%;
}

.chat-input-container .v-btn {
    flex-shrink: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-input-container .v-btn:not(.mic-pulse):hover {
    transform: scale(1.1);
    background-color: rgba(25, 118, 210, 0.08) !important;
}

.chat-input-container .v-btn:active {
    transform: scale(0.95);
}

.chat-input-container .v-text-field__slot {
    background: #f8f9fa;
    border-radius: 28px;
    padding: 0 20px;
    min-height: 44px;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
}

.chat-input-container .v-text-field__slot:hover {
    background: #f1f3f5;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.06);
}

.chat-input-container .v-text-field--outlined fieldset {
    border: none;
}

.chat-input-container .v-text-field--outlined.v-input--is-focused .v-text-field__slot {
    background: white;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2), inset 0 1px 3px rgba(0, 0, 0, 0.04);
}

.chat-input-container .v-text-field input {
    font-size: 15px;
    line-height: 1.5;
    caret-color: #1976D2;
}

.chat-input-container .v-text-field input::placeholder {
    color: #adb5bd;
    font-size: 14px;
}

.chat-input-container input[type="file"] {
    display: none;
}

.chat-input-container .v-progress-linear {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    height: 3px;
    background: transparent;
}

.chat-input-container .v-progress-linear .v-progress-linear__determinate {
    background: linear-gradient(90deg, #1976D2 0%, #42A5F5 100%);
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

@media (max-width: 600px) {
    .chat-input-container {
        padding: 8px 10px;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, 0.97);
    }
    
    .chat-input-container .d-flex.align-center {
        gap: 6px;
        padding: 0;
    }
    
    .chat-input-container .voice-recorder-container .message-input {
        min-height: 42px;
        padding: 0 16px;
        font-size: 16px;
    }
    
    .chat-input-container .voice-recorder-container .action-btn {
        width: 42px !important;
        height: 42px !important;
    }
    
    .chat-input-container .voice-recorder-container .action-btn i {
        font-size: 22px !important;
    }
    
    .chat-input-container .v-text-field__slot {
        min-height: 42px;
        padding: 0 16px;
        font-size: 16px;
    }
    
    .chat-input-container .v-text-field input {
        font-size: 16px;
    }
    
    .chat-input-container .v-btn {
        width: 42px !important;
        height: 42px !important;
    }
    
    .chat-input-container .v-btn .v-icon {
        font-size: 22px !important;
    }
    
    .chat-input-container .reply-preview {
        margin: 0 0 10px 0;
        padding: 8px 12px;
    }
}

@media (max-width: 380px) {
    .chat-input-container {
        padding: 6px 8px;
    }
    
    .chat-input-container .d-flex.align-center {
        gap: 4px;
    }
    
    .chat-input-container .voice-recorder-container .action-btn {
        width: 40px !important;
        height: 40px !important;
    }
    
    .chat-input-container .voice-recorder-container .message-input {
        min-height: 40px;
        padding: 0 14px;
    }
    
    .chat-input-container .v-btn {
        width: 40px !important;
        height: 40px !important;
    }
    
    .chat-input-container .v-text-field__slot {
        min-height: 40px;
        padding: 0 14px;
    }
}

@media (hover: hover) and (pointer: fine) {
    .chat-input-container .v-btn {
        position: relative;
        overflow: hidden;
    }
    
    .chat-input-container .v-btn::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(25, 118, 210, 0.1);
        transform: translate(-50%, -50%);
        transition: width 0.3s, height 0.3s;
    }
    
    .chat-input-container .v-btn:hover::before {
        width: 100%;
        height: 100%;
    }
}

.chat-input-container.keyboard-open {
    transition: none;
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .chat-input-container {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
}

.dark-theme .chat-input-container {
    background: rgba(30, 30, 30, 0.95);
    border-top-color: rgba(255, 255, 255, 0.05);
}

.dark-theme .chat-input-container .voice-recorder-container .message-input {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-color: rgba(255, 255, 255, 0.1);
}

.dark-theme .chat-input-container .voice-recorder-container .message-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: #42A5F5;
}

.dark-theme .chat-input-container .v-text-field__slot {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.dark-theme .chat-input-container .v-text-field__slot:hover {
    background: rgba(255, 255, 255, 0.08);
}

.dark-theme .chat-input-container .reply-preview {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
}

/* Smooth height transitions */
.chat-input-container .v-text-field textarea {
    min-height: 24px;
    max-height: 120px;
    overflow-y: auto;
    resize: none;
    transition: height 0.2s ease;
}

/* Typing indicator inside input */
.chat-input-typing {
    position: absolute;
    bottom: 100%;
    left: 20px;
    margin-bottom: 8px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 18px;
    font-size: 12px;
    white-space: nowrap;
    animation: fadeInUp 0.3s ease;
    pointer-events: none;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Desktop specific styles */
@media (min-width: 960px) {
    .chat-input-container {
        padding: 16px 20px;
        border-radius: 0;
        background: rgba(255, 255, 255, 0.98);
    }
    
    .chat-input-container > .d-flex.align-center {
        max-width: 1000px;
        margin: 0 auto;
        gap: 12px;
        width: 100%;
    }
    
    .chat-input-container .voice-recorder-container {
        flex: 1;
        min-width: 0;
    }
    
    .chat-input-container .voice-recorder-container .message-input {
        min-height: 48px;
        padding: 0 24px;
        border-radius: 24px;
        background: #f3f4f6;
        transition: all 0.2s ease;
        font-size: 16px;
    }
    
    .chat-input-container .voice-recorder-container .message-input:hover {
        background: #e5e7eb;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }
    
    .chat-input-container .voice-recorder-container .message-input:focus {
        transform: translateY(-1px);
        box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.12), 0 4px 16px rgba(0, 0, 0, 0.08);
    }
    
    .chat-input-container .voice-recorder-container .action-btn {
        width: 48px !important;
        height: 48px !important;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .chat-input-container .voice-recorder-container .action-btn i {
        font-size: 24px !important;
    }
    
    .chat-input-container .voice-recorder-container .action-btn:hover {
        background-color: rgba(25, 118, 210, 0.08) !important;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(25, 118, 210, 0.2);
    }
    
    .chat-input-container .voice-recorder-container .action-btn:active {
        transform: translateY(0);
        box-shadow: 0 2px 4px rgba(25, 118, 210, 0.2);
    }
    
    .chat-input-container .voice-recorder-container .v-text-field {
        width: 100%;
    }
    
    .chat-input-container .reply-preview {
        max-width: 1000px;
        margin: 0 auto 16px;
        border-radius: 12px;
        padding: 12px 16px;
    }
    
    .chat-input-container .v-text-field__slot {
        min-height: 48px;
        padding: 0 24px;
        border-radius: 24px;
        background: #f3f4f6;
        transition: all 0.2s ease;
    }
    
    .chat-input-container .v-text-field__slot:hover {
        background: #e5e7eb;
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }
    
    .chat-input-container .v-text-field--outlined.v-input--is-focused .v-text-field__slot {
        transform: translateY(-1px);
        box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.12), 0 4px 16px rgba(0, 0, 0, 0.08);
    }
    
    .chat-input-container .v-btn {
        width: 48px !important;
        height: 48px !important;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .chat-input-container .v-btn .v-icon {
        font-size: 24px !important;
    }
    
    .chat-input-container .v-btn:hover {
        background-color: rgba(25, 118, 210, 0.08) !important;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(25, 118, 210, 0.2);
    }
    
    .chat-input-container .v-btn:active {
        transform: translateY(0);
        box-shadow: 0 2px 4px rgba(25, 118, 210, 0.2);
    }
    
    .chat-input-container .v-text-field input {
        font-size: 16px;
        line-height: 1.6;
    }
    
    .chat-input-container .v-text-field input::placeholder {
        font-size: 15px;
    }
}

/* Large desktop screens */
@media (min-width: 1280px) {
    .chat-input-container > .d-flex.align-center,
    .chat-input-container .reply-preview {
        max-width: 1200px;
    }
    
    .chat-input-container {
        padding: 18px 24px;
    }
    
    .chat-input-container .voice-recorder-container .message-input {
        min-height: 52px;
        font-size: 16px;
    }
    
    .chat-input-container .voice-recorder-container .action-btn {
        width: 52px !important;
        height: 52px !important;
    }
    
    .chat-input-container .voice-recorder-container .action-btn i {
        font-size: 26px !important;
    }
    
    .chat-input-container .v-text-field__slot {
        min-height: 52px;
        font-size: 16px;
    }
    
    .chat-input-container .v-btn {
        width: 52px !important;
        height: 52px !important;
    }
    
    .chat-input-container .v-btn .v-icon {
        font-size: 26px !important;
    }
}

/* Extra large screens */
@media (min-width: 1920px) {
    .chat-input-container > .d-flex.align-center,
    .chat-input-container .reply-preview {
        max-width: 1400px;
    }
    
    .chat-input-container {
        padding: 20px 28px;
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.06);
    }
}

/* Tablet specific adjustments */
@media (min-width: 601px) and (max-width: 959px) {
    .chat-input-container {
        padding: 12px 16px;
    }
    
    .chat-input-container > .d-flex.align-center {
        max-width: 100%;
        margin: 0 auto;
        gap: 10px;
        width: 100%;
    }
    
    .chat-input-container .voice-recorder-container {
        flex: 1;
        min-width: 0;
    }
    
    .chat-input-container .voice-recorder-container .message-input {
        min-height: 46px;
        padding: 0 22px;
    }
    
    .chat-input-container .voice-recorder-container .action-btn {
        width: 46px !important;
        height: 46px !important;
    }
    
    .chat-input-container .v-text-field__slot {
        min-height: 46px;
        padding: 0 22px;
    }
    
    .chat-input-container .v-btn {
        width: 46px !important;
        height: 46px !important;
    }
}

/* Focus glow effect */
.chat-input-container.input-focused {
    box-shadow: 0 -4px 32px rgba(25, 118, 210, 0.15);
}

/* Medium screens */
@media (min-width: 768px) and (max-width: 959px) {
    .chat-input-container > .d-flex.align-center {
        max-width: 90%;
    }
}

/* Remove max-width on very large screens for better utilization */
@media (min-width: 2560px) {
    .chat-input-container > .d-flex.align-center,
    .chat-input-container .reply-preview {
        max-width: 1800px;
    }
}

/* Mic button special effects */
.chat-input-container .mic-pulse {
    animation: mic-pulse 1.5s infinite, rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* File upload button animation */
.chat-input-container .v-btn[aria-label*="paperclip"] {
    transition: all 0.3s ease;
}

.chat-input-container .v-btn[aria-label*="paperclip"]:hover {
    color: #1976D2;
}

/* Smooth transitions for all interactive elements */
.chat-input-container * {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* Better scroll behavior for reply preview */
.chat-input-container .reply-preview {
    scroll-behavior: smooth;
    position: relative;
}

/* Desktop hover effects for reply close button */
@media (hover: hover) {
    .chat-input-container .reply-preview .v-btn {
        opacity: 0.7;
        transition: all 0.2s ease;
    }
    
    .chat-input-container .reply-preview:hover .v-btn {
        opacity: 1;
    }
}

/* Chat container alignment with input bar */
@media (min-width: 960px) {
    .chat-messages {
        padding-bottom: 140px;
    }
}

/* Smooth keyboard appearance on mobile */
@media (max-width: 600px) {
    .chat-input-container {
        transition: transform 0.3s ease;
    }
    
    .keyboard-visible .chat-input-container {
        transform: translateY(0);
    }
}

/* Input field auto-resize behavior */
.chat-input-container.expanded {
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .chat-input-container,
    .chat-input-container * {
        animation: none !important;
        transition: none !important;
    }
}