body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    font-family: 'Noto Sans KR', sans-serif;
}

.chat-container {
    width: 90%;
    max-width: 600px;
    height: 80vh;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    padding: 20px;
    position: relative;
    margin: 20px;
}

/* 메시지들을 담는 컨테이너 추가 */
.messages-container {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
}

/* 입력 영역 컨테이너 */
.input-area {
    display: flex;
    gap: 15px;
    padding: 15px 20px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.05);
    margin: 15px auto;
    border: 1px solid rgba(0, 0, 0, 0.08);
    width: calc(100% - 40px);
    box-sizing: border-box;
    max-width: 800px;
}

.chat-bubble {
    max-width: 80%;
    margin: 10px;
    padding: 15px;
    border-radius: 20px;
    font-size: 16px;
    line-height: 1.4;
    word-wrap: break-word;
}

.user-bubble {
    align-self: flex-end;
    margin-left: auto;
    background-color: #007AFF;
    color: white;
    border-bottom-right-radius: 5px;
}

.bot-bubble {
    align-self: flex-start;
    margin-right: auto;
    background-color: #E9ECEF;
    color: #343A40;
    border-bottom-left-radius: 5px;
}

.chat-input {
    flex: 1;
    min-width: 0;
    padding: 15px 25px;
    border: 2px solid #e8e8e8;
    border-radius: 25px;
    font-size: 16px;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    color: #495057;
    font-family: 'Noto Sans KR', sans-serif;
}

.chat-input:focus {
    outline: none;
    border-color: #007AFF;
    background-color: white;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

.chat-input::placeholder {
    color: #adb5bd;
    font-weight: 400;
}

.send-button {
    min-width: 65px;
    height: 50px;
    border: none;
    border-radius: 25px;
    background: linear-gradient(135deg, #007AFF 0%, #1a88ff 100%);
    color: white;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    box-shadow: 0 4px 10px rgba(0, 122, 255, 0.2);
}

.send-button:hover {
    background: linear-gradient(135deg, #0056b3 0%, #0056b3 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 122, 255, 0.3);
}

.send-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 122, 255, 0.2);
}

/* 스크롤바 스타일링 */
.chat-container::-webkit-scrollbar {
    width: 8px;
}

.chat-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.chat-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 반응형 디자인 */
@media (max-width: 280px) {
    body {
        height: 100%;
        min-height: 100vh;
        padding: 0;
        margin: 0;
    }

    .chat-container {
        width: 100%;
        height: 100vh;
        margin: 0;
        padding: 10px;
        border-radius: 0;
        min-height: -webkit-fill-available;
    }

    .messages-container {
        height: calc(100vh - 140px);
        padding-bottom: 80px;
    }

    .input-area {
        padding: 10px;
        gap: 8px;
        background: #ffffff;
        border-radius: 15px;
        position: fixed;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 20px);
        margin: 10px auto;
        box-sizing: border-box;
        max-width: 400px;
    }

    .chat-bubble {
        max-width: 85%;
        font-size: 14px;
        padding: 12px;
    }

    .chat-input {
        padding: 12px 15px;
        font-size: 15px;
        width: 0;
    }

    .send-button {
        min-width: 50px;
        height: 45px;
        font-size: 14px;
        padding: 0 12px;
    }

    .mic-button {
        min-width: 45px;
        height: 45px;
    }

    .mic-button, .send-button {
        flex-shrink: 0;
    }
}

/* iOS Safari를 위한 추가 스타일 */
@supports (-webkit-touch-callout: none) {
    .chat-container {
        height: -webkit-fill-available;
    }
}

/* 로딩 애니메이션 스타일 */
.typing-indicator {
    display: flex;
    padding: 15px;
    gap: 5px;
}

.typing-circle {
    width: 8px;
    height: 8px;
    background-color: #90949c;
    border-radius: 50%;
    animation: typing-animation 1s infinite ease-in-out;
}

.typing-circle:nth-child(1) { animation-delay: 200ms; }
.typing-circle:nth-child(2) { animation-delay: 300ms; }
.typing-circle:nth-child(3) { animation-delay: 400ms; }

@keyframes typing-animation {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* 로딩 인디케이터를 위한 컨테이너 */
.loading-container {
    display: none;
    align-self: flex-start;
    background-color: #E9ECEF;
    border-radius: 20px;
    border-bottom-left-radius: 5px;
    margin: 10px;
}

/* 마이크 버튼 스타일 */
.mic-button {
    min-width: 50px;
    height: 50px;
    border: none;
    border-radius: 25px;
    background: #f8f9fa;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #e8e8e8;
}

.mic-button:hover {
    background: #e9ecef;
    color: #007AFF;
}

.mic-button.recording {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}