/* 组件样式 */

/* 消息组件 */
.message {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    animation: messageSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    margin-bottom: 1rem;
}

.message.own {
    align-self: flex-end;
    align-items: flex-end;
}

.message.other {
    align-self: flex-start;
    align-items: flex-start;
}

.message::before {
    content: '';
    position: absolute;
    top: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #07c160, #00d4aa);
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.message:hover::before {
    opacity: 1;
}

.message.own::before {
    right: -8px;
}

.message.other::before {
    left: -8px;
}

.message-content {
    background-color: #f5f5f5;
    padding: 1rem 1.25rem;
    border-radius: 20px;
    margin-bottom: 0.5rem;
    word-wrap: break-word;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    backdrop-filter: blur(10px);
}

.message-content:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.message.own .message-content {
    background: linear-gradient(135deg, #07c160, #1aad19);
    color: white;
    box-shadow: 0 2px 8px rgba(7, 193, 96, 0.3);
}

.message.own .message-content:hover {
    box-shadow: 0 4px 12px rgba(7, 193, 96, 0.4);
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #999;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.message-time {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    font-size: 0.7rem;
    backdrop-filter: blur(5px);
}

.message.own .message-time {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

.message-status {
    font-size: 0.8rem;
    opacity: 0.8;
}

.status-sending {
    color: #fbbf24;
}

.status-sent {
    color: #10b981;
}

.status-failed {
    color: #ef4444;
}

/* 文本消息 */
.text-message {
    white-space: pre-wrap;
}

/* 文件消息 */
.file-message {
    min-width: 200px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.file-icon {
    font-size: 2rem;
    flex-shrink: 0;
    background: linear-gradient(135deg, #07c160, #00d4aa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 4px rgba(7, 193, 96, 0.3));
}

.file-details {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    margin-bottom: 0.25rem;
    word-break: break-all;
}

.file-size {
    font-size: 0.8rem;
    opacity: 0.7;
}

.download-btn {
    background: linear-gradient(135deg, #07c160, #1aad19);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(7, 193, 96, 0.3);
    position: relative;
    overflow: hidden;
}

.download-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.download-btn:hover::before {
    left: 100%;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(7, 193, 96, 0.4);
}

.message.own .download-btn {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2);
}

.message.own .download-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

/* 图片预览 */
.image-preview {
    margin-top: 0.5rem;
}

.image-preview img {
    display: block;
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    object-fit: cover;
}

/* 文件上传组件 - 简化版 */

.upload-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #07c160;
    font-weight: 500;
    padding: 0.75rem;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    border: 1px solid rgba(7, 193, 96, 0.2);
}

.upload-spinner {
    animation: spin 1s linear infinite;
    font-size: 1.5rem;
}

.upload-progress {
    width: 100%;
    height: 6px;
    background-color: rgba(7, 193, 96, 0.2);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #07c160, #00d4aa);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 1.5s infinite;
}

/* 消息输入组件 - 微信移动端风格 */
.message-input {
    width: 100%;
    display: flex;
    align-items: center;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.input-field-container {
    flex: 1;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    padding: 0;
    position: relative;
    min-height: 40px;
}

/* 文件上传按钮 - 微信移动端风格 */
.file-button {
    background: #ffffff;
    border: 1px solid #d9d9d9;
    color: #666666;
    padding: 0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    touch-action: manipulation;
}

.file-button:hover:not(:disabled) {
    background: #f5f5f5;
    border-color: #bfbfbf;
}

.file-button:active:not(:disabled) {
    background: #e6e6e6;
    border-color: #999999;
}

.input-field-container textarea {
    flex: 1;
    border: none;
    padding: 10px 12px;
    font-size: 16px;
    resize: none;
    min-height: 20px;
    max-height: 100px;
    background: transparent;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.4;
    outline: none;
}

.input-field-container textarea::placeholder {
    color: #999999;
    font-style: normal;
}

.input-field-container:focus-within {
    border-color: #07c160;
}

.send-button {
    background: #07c160;
    color: white;
    border: none;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 4px;
    touch-action: manipulation;
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    opacity: 0;
}

/* 发送按钮显示状态 */
.send-button.show {
    transform: translateY(-50%) scale(1);
    opacity: 1;
}

.send-button:hover:not(:disabled) {
    background: #06ad56;
}

.send-button:active:not(:disabled) {
    background: #059748;
    transform: translateY(-50%) scale(0.95);
}

.send-button:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

/* 发送图标样式 */
.send-icon {
    width: 16px;
    height: 16px;
    color: white;
}

/* 发送按钮加载状态 */
.send-button.loading {
    background: #cccccc;
    cursor: not-allowed;
}

.send-button.loading .send-icon {
    animation: spin 1s linear infinite;
}
