/* public/css/chat.css */
/* 全局样式重置 */
body, h1, ul, li, form, input, button {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #1a1a1a;
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

.chat-container {
    background: #222;  /* 调整为与index.css相同的背景色 */
    width: 100%;
    max-width: 500px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    border-radius: 10px; /* 调整为与index.css中的元素一致 */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5); /* 与index.css中的模态框一致 */
    overflow: hidden;
    position: relative;
    animation: containerFadeIn 0.5s ease-in-out;
}

@keyframes containerFadeIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.chat-header {
    padding: 15px;  /* 减小padding以节省空间 */
    background-color: #292929;
    color: #f0f0f0;
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.chat-header h1 {
    margin: 0;
    font-size: 1.5em;
    color: #ff8a00;  /* 统一色调，与主页面一致 */
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: glowingText 3s linear infinite;
}

@keyframes glowingText {
    0%, 100% {
        text-shadow: 0 0 5px #ff3d00, 0 0 10px #ff3d00, 0 0 20px #ff8a00;
    }
    50% {
        text-shadow: 0 0 20px #ff8a00, 0 0 30px #ff8a00, 0 0 40px #ff8a00;
    }
}

.messages-list {
    list-style: none;
    padding: 20px;
    margin: 0;
    flex: 1;
    overflow-y: auto;
    background-color: #1a1a1a;  /* 与主页面一致的背景色 */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.messages-list li {
    padding: 15px;
    border-radius: 15px;
    max-width: 75%;
    word-wrap: break-word;
    position: relative;
    font-size: 0.9em;
    background: #333;  /* 调整为更符合主页面风格的背景色 */
    color: #ffffff;
    box-shadow: 4px 4px 10px #0e0e0e, -4px -4px 10px #2e2e2e;
    animation: fadeInUp 0.4s ease-in-out;
}

.messages-list .customer {
    background: linear-gradient(145deg, #f95700, #ff8a00); /* 保持原有的客户消息样式 */
    align-self: flex-end;
    border-radius: 15px 0 15px 15px;
}

.messages-list .agent {
    background: #444;  /* 与主页面风格更协调 */
    align-self: flex-start;
    border-radius: 0 15px 15px 15px;
}

.message-info {
    font-size: 0.75em;
    color: #aaaaaa;
    margin-top: 8px;
}

.message-form {
    display: flex;
    padding: 15px;
    background-color: #292929;
    border-top: 1px solid #444;
    position: sticky;
    bottom: 0;
    z-index: 10;
    gap: 10px;
    box-shadow: inset 4px 4px 10px #0e0e0e, inset -4px -4px 10px #2e2e2e;
}

#uploadButton {
    background: #444;  /* 保持按钮样式与主页面一致 */
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 4px 4px 10px #0e0e0e, -4px -4px 10px #2e2e2e;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

#uploadButton:hover {
    transform: translateY(-3px);
    box-shadow: 6px 6px 15px #0e0e0e, -6px -6px 15px #2e2e2e;
}

#messageInput {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #444;
    border-radius: 25px;
    font-size: 1em;
    outline: none;
    background-color: #1a1a1a;
    color: #ffffff;
    box-shadow: inset 4px 4px 10px #0e0e0e, inset -4px -4px 10px #2e2e2e;
    transition: border-color 0.3s ease;
}

#messageInput:focus {
    border-color: #ff8a00;
}

button {
    padding: 12px 20px;
    background: #444; /* 统一按钮背景色 */
    color: #ffffff;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    box-shadow: 4px 4px 10px #0e0e0e, -4px -4px 10px #2e2e2e;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 6px 6px 15px #0e0e0e, -6px -6px 15px #2e2e2e;
}

.typing-indicator {
    padding: 10px;
    font-size: 0.85em;
    color: #aaaaaa;
    background-color: #292929;
    text-align: center;
    position: sticky;
    bottom: 50px;
    z-index: 5;
    box-shadow: inset 4px 4px 10px #0e0e0e, inset -4px -4px 10px #2e2e2e;
}

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