/**
 * AI聊天模块 - 输入区域样式
 * 包含输入框、文件预览、发送按钮、模型选择器等样式
 */

.input-wrapper {
    width: 100%;
    padding: 0 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    transition: left 0.3s ease, width 0.3s ease;
}

.sidebar.collapsed~.main-content .input-wrapper {
    left: 0;
    width: 100%;
}

.input-wrapper:not(.has-chat) {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
}

.input-wrapper.has-chat {
    top: auto;
    bottom: 0;
    transform: translateY(0);
}

.welcome-text {
    margin-bottom: 30px;
    font-size: 2rem;
    font-weight: 600;
    opacity: 1;
    transition: opacity 0.3s;
    color: var(--primary-color);
}

.input-wrapper.has-chat .welcome-text {
    opacity: 0;
    pointer-events: none;
    display: none;
}

.input-box {
    width: 100%;
    max-width: var(--input-max-width);
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-radius: 28px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--glass-border);
    box-shadow: 
        0 8px 32px rgba(22, 119, 255, 0.12),
        inset 0 1px 1px rgba(255, 255, 255, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-box:focus-within {
    background: var(--glass-bg-hover);
    box-shadow: 
        0 12px 40px rgba(22, 119, 255, 0.2),
        inset 0 1px 1px rgba(255, 255, 255, 0.6);
}

.file-preview-area {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    padding: 0 5px;
}

.file-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 
        0 4px 12px rgba(22, 119, 255, 0.1),
        inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.file-preview-item img,
.file-preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-delete-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    transition: background-color 0.2s;
}

.file-delete-btn:hover {
    background-color: rgba(255, 77, 79, 0.8);
}

.input-textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-color);
    resize: none;
    outline: none;
    font-size: 1rem;
    max-height: 200px;
    min-height: 24px;
    margin-bottom: 10px;
    padding: 0 5px;
}

.input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.left-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 4px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.toolbar-divider {
    width: 1px;
    height: 20px;
    background-color: var(--border-color);
    margin: 0 2px;
}

.model-selector-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 4px 0 8px;
}

.model-icon {
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: color 0.2s;
}

.model-selector-inline:hover .model-icon {
    color: var(--primary-color);
}

.model-select-inline {
    padding: 8px 28px 8px 12px;
    border-radius: 8px;
    border: none;
    background-color: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
    min-width: 100px;
    font-weight: 500;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
}

.model-select-inline:hover {
    color: var(--primary-color);
    background-color: rgba(255, 255, 255, 0.5);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231677ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.model-select-inline:focus {
    color: var(--primary-color);
    background-color: rgba(22, 119, 255, 0.08);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231677ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.model-select-inline option {
    background-color: var(--input-bg);
    color: var(--text-color);
    padding: 10px 16px;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 6px;
    margin: 2px 6px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.action-btn:hover {
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.action-btn.active {
    color: var(--primary-color);
    background: rgba(22, 119, 255, 0.15);
    border-color: rgba(22, 119, 255, 0.3);
}

.send-btn {
    background: rgba(200, 200, 200, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: not-allowed;
    opacity: 0.6;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2);
}

.send-btn.ready {
    background: var(--user-glass-bg);
    border: 1px solid var(--user-glass-border);
    color: #fff;
    cursor: pointer;
    opacity: 1;
    box-shadow: 
        0 4px 16px rgba(22, 119, 255, 0.3),
        inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.send-btn.ready:hover {
    background: var(--user-glass-bg-hover);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 8px 24px rgba(22, 119, 255, 0.4),
        inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.footer-note {
    margin-top: 12px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 1;
}

.input-wrapper.has-chat .footer-note {
    display: none;
}
