* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100vh;
    overflow: hidden;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 100%;
    margin: 0 auto;
    background-color: #b2c7d9;
}

/* 헤더 */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background-color: #b2c7d9;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-picture {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #e0e0e0;
}

.profile-picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.contact-info {
    display: flex;
    flex-direction: column;
}

.contact-name {
    font-size: 16px;
    font-weight: 600;
    color: #000;
}

.status-indicator {
    font-size: 12px;
    color: #666;
}

.header-right {
    display: flex;
    gap: 8px;
}

.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    transition: background-color 0.2s;
}

.icon-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* 채팅 영역 */
.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #b2c7d9;
}

.welcome-message {
    text-align: center;
    padding: 40px 20px;
    color: #555;
}

.welcome-message p {
    margin-bottom: 10px;
    font-size: 15px;
}

.message-group {
    display: flex;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-group.sent {
    justify-content: flex-end;
}

.message-group.received {
    justify-content: flex-start;
}

.message-group.received .message-content {
    align-items: flex-start;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    background-color: #e0e0e0;
    overflow: hidden;
    flex-shrink: 0;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-content {
    display: flex;
    flex-direction: column;
    max-width: 60%;
}

.message-group.sent .message-content {
    align-items: flex-end;
}

.sender-name {
    font-size: 13px;
    color: #000;
    margin-bottom: 4px;
    font-weight: 600;
}

.message-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    word-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
    line-height: 1.6;
    font-size: 15px;
}

.message-group.sent .message-bubble {
    background-color: #fee500;
    color: #000;
    border-bottom-right-radius: 4px;
}

.message-group.received .message-bubble {
    background-color: #fff;
    color: #000;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.message-group.sent .message-time {
    justify-content: flex-end;
}

.loading-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background-color: #fff;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #999;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* 입력 영역 */
.input-area {
    background-color: #fff;
    border-top: 1px solid #e0e0e0;
    padding: 12px 20px;
}

.input-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.tool-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: background-color 0.2s;
}

.tool-btn:hover {
    background-color: #f5f5f5;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

#messageInput {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

#messageInput:focus {
    border-color: #999;
}

.send-btn {
    padding: 10px 24px;
    background-color: #999;
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.send-btn:hover {
    background-color: #777;
}

.send-btn:active {
    transform: scale(0.98);
}

.send-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* 스크롤바 스타일 */
.chat-area::-webkit-scrollbar {
    width: 8px;
}

.chat-area::-webkit-scrollbar-track {
    background: transparent;
}

.chat-area::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.chat-area::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .message-content {
        max-width: 80%;
    }
    
    .input-area {
        padding: 10px 15px;
    }
    
    .chat-header {
        padding: 10px 15px;
    }
}

