/* 天空语音页面样式 */

/* 主容器样式 */
.voice-main {
    margin-left: 280px;
    min-height: 100vh;
    background: linear-gradient(to bottom, #1a1a2e, #30475e);
    background-image: url('01001.gif');
    background-size: cover;
    background-position: center;
    background-blend-mode: overlay;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.voice-container {
    width: 100%;
    max-width: 500px;
    height: 90vh;
    background: linear-gradient(to bottom, #1a1a2e, #30475e);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

/* 顶部状态栏 */
.voice-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #000;
    color: #fff;
    height: 40px;
}

.voice-time {
    font-weight: bold;
}

.voice-battery {
    color: #4cd964;
    font-weight: bold;
}

/* 用户信息区域 */
.voice-user-info {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.voice-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 15px;
    border: 2px solid #fff;
}

.voice-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.voice-user-details {
    flex: 1;
}

.voice-welcome {
    color: #fff;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
}

.voice-user-id {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.voice-controls {
    display: flex;
    gap: 10px;
}

.voice-menu-btn,
.voice-close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

/* 座位选择区域 */
.voice-seats-container {
    padding: 20px;
}

.voice-seats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.voice-seat {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #fff;
}

.voice-seat-icon {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.voice-seat-icon i {
    font-size: 24px;
    color: rgba(255, 255, 255, 0.8);
}

.voice-seat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.voice-seat-active .voice-seat-icon {
    background-color: rgba(212, 175, 55, 0.3);
    border: 2px solid #d4af37;
}

.voice-seat-active .voice-seat-icon i {
    color: #d4af37;
}

/* 系统通知区域 */
.voice-system-notice {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px 15px;
    margin: 10px;
    border-radius: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

/* 聊天消息区域样式 */
.voice-chat-messages {
    overflow-y: auto;
    padding: 15px;
    height: 40vh;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    margin: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.voice-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.voice-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.voice-chat-messages::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

/* 消息样式 */
.voice-message {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 10px 15px;
    margin-bottom: 5px;
    max-width: 80%;
    align-self: flex-start;
    animation: fadeIn 0.3s ease;
    word-break: break-word;
    border-bottom-left-radius: 5px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.voice-message-self {
    background-color: rgba(0, 132, 255, 0.3);
    align-self: flex-end;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 5px;
}

.voice-message-user {
    display: block;
    font-weight: bold;
    font-size: 0.85em;
    margin-bottom: 3px;
    color: #ffcc66;
}

.voice-message-self .voice-message-user {
    color: #66ccff;
}

.voice-message-content {
    display: block;
    color: white;
    font-size: 0.95em;
    line-height: 1.4;
}

/* 系统消息样式 */
.voice-system-message {
    background-color: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    margin: 10px auto;
    max-width: 90%;
    align-self: center;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(2px);
}

/* 聊天输入框样式 */
.voice-chat-input {
    display: flex;
    margin: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 5px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    max-height: 0;
    overflow: hidden;
}

.voice-chat-input.active {
    opacity: 1;
    transform: translateY(0);
    max-height: 200px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.voice-chat-input textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    padding: 10px 15px;
    resize: none;
    font-size: 0.95em;
    line-height: 1.4;
    height: 42px;
    min-height: 42px;
    max-height: 100px;
    outline: none;
    font-family: 'Poppins', 'Microsoft YaHei', sans-serif;
}

.voice-chat-input textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.voice-chat-input textarea:focus {
    outline: none;
}

.voice-send-btn {
    width: 42px;
    height: 42px;
    background: linear-gradient(45deg, #2196f3, #3f51b5);
    border: none;
    border-radius: 50%;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.voice-send-btn:hover {
    transform: scale(1.05);
}

.voice-send-btn:active {
    transform: scale(0.95);
}

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

/* 底部控制栏优化 */
.voice-bottom-controls {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.5);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    backdrop-filter: blur(5px);
    gap: 5px;
}

.voice-control-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.voice-control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

.voice-control-btn:active {
    transform: scale(0.95);
}

.voice-chat-btn {
    background: linear-gradient(to right, #8e44ad, #9b59b6);
    border-radius: 20px;
    padding: 5px 15px;
    width: auto;
    height: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 3px 10px rgba(142, 68, 173, 0.3);
}

.voice-chat-btn:hover {
    background: linear-gradient(to right, #7d3c98, #8e44ad);
}

.voice-chat-btn.active {
    background: linear-gradient(to right, #6c3483, #7d3c98);
    box-shadow: 0 3px 15px rgba(142, 68, 173, 0.5);
}

.voice-button-label {
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
}

.voice-gift-btn {
    background: linear-gradient(to right, #ff6b6b, #ff8e8e);
    border-radius: 20px;
    padding: 5px 15px;
    width: auto;
    height: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 3px 10px rgba(255, 107, 107, 0.3);
}

.voice-gift-btn:hover {
    background: linear-gradient(to right, #ff5252, #ff7676);
}

.voice-gift-label {
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .voice-main {
        margin-left: 0;
        padding: 0;
    }
    
    .voice-container {
        height: 100vh;
        max-width: 100%;
        border-radius: 0;
    }
}

@media (max-width: 480px) {
    .voice-bottom-controls {
        padding: 10px 5px;
        gap: 2px;
    }
    
    .voice-control-btn {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
    
    .voice-gift-btn {
        padding: 5px 10px;
        height: 35px;
    }
    
    .voice-gift-label {
        font-size: 12px;
    }
}

/* WebRTC连接状态指示器 */
.rtc-status {
    position: absolute;
    right: 50px;
    top: 10px;
    font-size: 16px;
    color: #aaa;
    transition: color 0.3s ease, transform 0.3s ease;
}

.rtc-status.connected {
    color: #2ecc71;
}

.rtc-status.connecting {
    color: #f39c12;
    animation: blink 1s infinite;
}

.rtc-status.disconnected {
    color: #e74c3c;
}

.rtc-status:hover {
    transform: scale(1.2);
    cursor: help;
}

@keyframes blink {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

/* 即时聊天样式增强 */
.voice-self-message {
    background-color: rgba(52, 152, 219, 0.1);
    margin-left: 20px;
    border-left: 3px solid #3498db;
    align-self: flex-end;
    max-width: 85%;
}

.voice-chat-message {
    position: relative;
    transition: transform 0.2s ease, opacity 0.2s ease;
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    overflow-wrap: break-word;
    word-break: break-word;
}

.voice-chat-message:hover {
    background-color: rgba(255, 255, 255, 0.12);
}

.voice-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-size: 0.85em;
}

.voice-chat-user {
    font-weight: bold;
    color: #3498db;
}

.voice-self-message .voice-chat-user {
    color: #2ecc71;
}

.voice-chat-time {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8em;
}

.voice-chat-content {
    line-height: 1.4;
}

.voice-chat-content a {
    color: #3498db;
    text-decoration: underline;
    word-break: break-all;
}

.voice-chat-content a:hover {
    color: #2980b9;
}

.voice-chat-message.new-message {
    animation: newMessage 0.5s ease;
}

@keyframes newMessage {
    0% { transform: translateY(20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* 聊天容器改進 */
.voice-chat-messages {
    display: flex;
    flex-direction: column;
    padding: 15px;
}

/* 系統消息樣式改進 */
.voice-system-message {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85em;
    margin: 8px 0;
    padding: 5px 10px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    max-width: 80%;
    align-self: center;
}

/* 聊天輸入框改進 */
#chat-textarea {
    border-radius: 18px;
    padding: 10px 15px;
    background-color: rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease;
}

#chat-textarea:focus {
    background-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.3);
}

.voice-send-btn {
    background-color: #3498db;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.voice-send-btn:hover {
    background-color: #2980b9;
    transform: scale(1.05);
}

.voice-send-btn:active {
    transform: scale(0.95);
}

/* 優化聊天區域滾動效果 */
.voice-chat-messages {
    scrollbar-width: thin;
    scrollbar-color: rgba(52, 152, 219, 0.5) rgba(0, 0, 0, 0.1);
}

.voice-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.voice-chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.voice-chat-messages::-webkit-scrollbar-thumb {
    background-color: rgba(52, 152, 219, 0.5);
    border-radius: 3px;
}

/* 添加未讀消息指示器 */
.unread-messages-indicator {
    position: absolute;
    bottom: 80px;
    right: 20px;
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transform: scale(0);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}

.unread-messages-indicator.visible {
    transform: scale(1);
}

.unread-messages-indicator:hover {
    transform: scale(1.1);
}

/* 輸入中提示 */
.typing-indicator {
    display: none;
    align-items: center;
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.6);
    margin: 5px 0;
    padding: 3px 10px;
    border-radius: 15px;
    background-color: rgba(255, 255, 255, 0.05);
    align-self: flex-start;
}

.typing-indicator.visible {
    display: flex;
}

.typing-indicator span {
    margin-right: 5px;
}

.typing-indicator .dots {
    display: flex;
}

.typing-indicator .dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.6);
    margin: 0 1px;
    animation: typingDot 1.4s infinite ease-in-out;
}

.typing-indicator .dot:nth-child(1) {
    animation-delay: 0s;
}

.typing-indicator .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

/* 表情選擇器樣式 */
.emoji-picker {
    position: fixed;
    background-color: #222;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
    z-index: 1000;
    max-width: 300px;
    animation: fadeIn 0.2s ease;
}

.emoji-button {
    background: none;
    border: none;
    font-size: 20px;
    padding: 5px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.emoji-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.emoji-close-button {
    grid-column: 1 / -1;
    background-color: #444;
    border: none;
    color: white;
    padding: 5px;
    margin-top: 5px;
    border-radius: 4px;
    cursor: pointer;
}

/* 輸入中提示樣式 */
.typing-indicator {
    display: none;
    align-items: center;
    font-size: 0.8em;
    color: rgba(255, 255, 255, 0.6);
    margin: 5px 0;
    padding: 3px 10px;
    border-radius: 15px;
    background-color: rgba(255, 255, 255, 0.05);
    align-self: flex-start;
}

.typing-indicator.visible {
    display: flex;
}

.typing-indicator span {
    margin-right: 5px;
}

.typing-indicator .dots {
    display: flex;
}

.typing-indicator .dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.6);
    margin: 0 1px;
    animation: typingDot 1.4s infinite ease-in-out;
}

.typing-indicator .dot:nth-child(1) {
    animation-delay: 0s;
}

.typing-indicator .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingDot {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

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