/* 超时提示样式 */
.timeout-notice {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #fed7d7;
    color: #9b2c2c;
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
    border-left: 4px solid #e53e3e;
    max-width: 400px;
}

.timeout-notice i {
    font-size: 18px;
    color: #e53e3e;
}

.timeout-notice span {
    color: #9b2c2c;
    font-size: 14px;
    line-height: 1.4;
}

/* 重试消息样式 */
.retry-message .message-text {
    background: #fffaf0;
    border: 1px solid #ed8936;
    border-radius: 18px;
    padding: 15px;
}

.retry-message .message-text p {
    color: #9c4221;
    margin-bottom: 12px;
    font-weight: 500;
}

.retry-options {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.retry-btn {
    padding: 8px 16px;
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    font-weight: 500;
}

.retry-btn:hover {
    background: #3182ce;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.retry-btn:active {
    transform: translateY(0);
}

.retry-btn.cancel-btn {
    background: #e2e8f0;
    color: #4a5568;
}

.retry-btn.cancel-btn:hover {
    background: #cbd5e0;
    color: #2d3748;
}

.retry-btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.retry-btn:disabled:hover {
    background: #cbd5e0;
}

/* 重试通知消息样式 */
.retry-notice .message-text {
    background: #ebf8ff;
    border: 1px solid #4299e1;
    color: #2b6cb0;
    font-style: italic;
    padding: 12px 15px;
}

.retry-notice .message-text i {
    margin-right: 8px;
    color: #4299e1;
}

/* 连接状态指示器 */
.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    padding: 4px 10px;
    border-radius: 12px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
}

.connection-status.connecting {
    color: #d69e2e;
}

.connection-status.connected {
    color: #38a169;
}

.connection-status.disconnected {
    color: #e53e3e;
}

.connection-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.connection-status.connecting::before {
    background: #d69e2e;
    animation: pulse 1.5s infinite;
}

.connection-status.connected::before {
    background: #38a169;
}

.connection-status.disconnected::before {
    background: #e53e3e;
}

@keyframes pulse {
    0% { 
        opacity: 0.6; 
        transform: scale(0.9);
    }
    50% { 
        opacity: 1; 
        transform: scale(1.1);
    }
    100% { 
        opacity: 0.6; 
        transform: scale(0.9);
    }
}

/* 输入框状态指示 */
.input-wrapper.connecting textarea {
    border-color: #d69e2e;
    box-shadow: 0 0 0 3px rgba(214, 158, 46, 0.1);
}

.input-wrapper.error textarea {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.input-wrapper.connected textarea {
    border-color: #38a169;
}

/* 加载动画增强 */
.loading-spinner {
    text-align: center;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.spinner {
    width: 60px;
    height: 60px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

#loading-text {
    color: #4a5568;
    font-size: 16px;
    font-weight: 500;
}

/* 添加上传提示样式 */
.upload-notice {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4299e1;
    color: white;
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
    border-left: 4px solid #2b6cb0;
    max-width: 400px;
}

.upload-notice i {
    font-size: 18px;
    color: white;
}

.upload-notice span {
    color: white;
    font-size: 14px;
    line-height: 1.4;
}

/* 滑动动画 */
@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 模型标签增强样式 */
.model-tag.code-expert {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(66, 153, 225, 0.3);
}

.model-tag.chat-assistant {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(72, 187, 120, 0.3);
}

.model-tag.long-context {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(237, 137, 54, 0.3);
}

/* 状态指示器增强 */
.status-indicator.active {
    color: #38a169;
    font-weight: 500;
}

.status-indicator.active::before {
    background: #38a169;
    box-shadow: 0 0 8px rgba(56, 161, 105, 0.5);
}

/* 消息时间戳增强 */
.message-time {
    font-size: 12px;
    color: #a0aec0;
    margin-top: 5px;
    padding: 0 5px;
    font-weight: 400;
}

/* 响应式调整 - 超时和重试样式 */
@media (max-width: 768px) {
    .timeout-notice {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .upload-notice {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .retry-options {
        flex-direction: column;
    }
    
    .retry-btn {
        width: 100%;
        justify-content: center;
    }
    
    .retry-message .message-text {
        padding: 12px;
    }
    
    .retry-message .message-text p {
        font-size: 14px;
    }
    
    .model-switch-notice {
        top: 60px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* 输入框加载状态 */
.input-wrapper.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 16px;
    pointer-events: none;
}

.input-wrapper.loading textarea {
    border-color: #667eea;
}

/* 按钮加载状态 */
.btn-send:disabled {
    position: relative;
    overflow: hidden;
}

.btn-send:disabled::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.3), 
        transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* 错误消息样式 */
.message.assistant.error .message-text {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #9b2c2c;
}

.message.assistant.error .message-text::before {
    content: '⚠️ ';
    margin-right: 5px;
}

/* 模型切换通知样式 */
.model-switch-notice {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
    border-left: 4px solid #667eea;
    max-width: 400px;
}

.model-switch-notice i {
    color: #667eea;
    font-size: 18px;
}

.model-switch-notice span {
    color: #4a5568;
    font-size: 14px;
}

/* 添加上传按钮样式增强 */
.btn-attach {
    position: relative;
    transition: all 0.3s;
}

.btn-attach:hover {
    background: #4299e1;
    color: white;
    border-color: #4299e1;
    transform: rotate(15deg) scale(1.1);
}

.btn-attach:active {
    transform: rotate(0) scale(0.95);
}

.btn-attach.uploading {
    background: #4299e1;
    color: white;
    border-color: #4299e1;
    animation: pulse-upload 1.5s infinite;
}

@keyframes pulse-upload {
    0% {
        box-shadow: 0 0 0 0 rgba(66, 153, 225, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(66, 153, 225, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(66, 153, 225, 0);
    }
}