/* 채팅 시스템 CSS */

/* Chat Box */
.chat-box {
    padding: 15px;
    display: flex;
    flex-direction: column;
    height: 600px;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.chat-header h3 {
    font-size: 16px;
    color: #333;
}

.chat-icons {
    display: flex;
    gap: 5px;
}

.chat-refresh, .chat-settings, .set-nickname-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.chat-refresh:hover, .chat-settings:hover, .set-nickname-btn:hover {
    background-color: #f0f0f0;
}

/* 새로고침 버튼 애니메이션 */
.chat-refresh {
    color: #4CAF50;
    position: relative;
    transform: none !important; /* 버튼 박스는 고정 */
}

.chat-refresh::before {
    content: "🔄";
    display: inline-block;
    animation: spin 2s linear infinite;
    transform-origin: center center;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.chat-refresh:hover {
    color: #45a049;
    transform: none !important; /* 호버시에도 버튼 박스는 고정 */
}

.chat-refresh:hover::before {
    animation-duration: 0.5s; /* 호버시 더 빠르게 회전 */
}

.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 8px;
    background-color: #fafafa;
}

.chat-messages {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.chat-message {
    margin-bottom: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    background-color: white;
    border-left: 3px solid #4CAF50;
    font-size: 13px;
    line-height: 1.4;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    animation: fadeIn 0.3s ease-in;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.username {
    font-weight: bold;
    color: #2196F3;
    font-size: 12px;
}

.time {
    color: #999;
    font-size: 10px;
}

.message-content {
    color: #333;
    word-wrap: break-word;
    word-break: break-word;
}

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

.chat-time {
    color: #999;
    font-size: 11px;
    margin-right: 5px;
}

.chat-user {
    font-weight: bold;
    color: #2196F3;
    margin-right: 5px;
}

.chat-text {
    word-wrap: break-word;
    flex: 1;
}

.chat-input-container {
    flex-shrink: 0;
}

.login-required {
    text-align: center;
    padding: 15px;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    color: #856404;
}

.chat-input-form {
    display: flex;
    gap: 8px;
}

#chat-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

#send-btn {
    padding: 8px 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}

#send-btn:hover {
    background-color: #45a049;
}

#send-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}