body {
    margin: 0;
    padding: 0;
    font-family: 'Noto Sans KR', sans-serif;
    background-color: #faf9f8;
}

.container {
    display: flex;
    height: 100vh;
    position: relative;
}

.left-panel {
    flex: 1;
    position: relative;
    background-color: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
}

.right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: transparent;
    padding: 20px;
}

.center-panel {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

#live2d-canvas {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: 100%;
    height: 100%;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-history {
    height: 66vh;
    overflow-y: auto;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.message {
    margin-bottom: 20px;
    max-width: 80%;
    display: flex;
    align-items: flex-start;
    position: relative;
}

.user-message {
    margin-left: auto;
    flex-direction: row-reverse;
}

.ai-message {
    margin-right: auto;
}

.message-profile {
    min-width: 38px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    margin: 0 8px;
    position: relative;
    background-color: #fff;
    border: 1px solid #e6e6e6;
    overflow: hidden;
}

.message-profile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/*.ai-badge {*/
/*    position: absolute;*/
/*    bottom: -2px;*/
/*    right: -2px;*/
/*    background-color: #007bff;*/
/*    color: white;*/
/*    font-size: 8px;*/
/*    padding: 2px 4px;*/
/*    border-radius: 8px;*/
/*    border: 1px solid white;*/
/*}*/

.message-bubble {
    display: flex;
    flex-direction: column;
    max-width: calc(100% - 100px);
}

.message-content {
    padding: 10px 16px;
    border-radius: 16px;
    position: relative;
    word-break: break-word;
    font-size: 15px;
    line-height: 1.4;
}

.user-message .message-content {
    background-color: #a3e6ff;
    color: #000;
    margin-right: 12px;
    border-top-right-radius: 2px;
}

.user-message .message-content::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 0;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #a3e6ff 50%, transparent 50%);
}

.ai-message .message-content {
    background-color: #ffffff;
    color: #000;
    margin-left: 12px;
    border-top-left-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.ai-message .message-content::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 0;
    width: 12px;
    height: 12px;
    background: linear-gradient(225deg, #ffffff 50%, transparent 50%);
}

.message-header {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    font-size: 12px;
    color: #666;
}

.user-message .message-header {
    justify-content: flex-end;
    margin-right: 12px;
}

.ai-message .message-header {
    margin-left: 12px;
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    align-self: flex-end;
}

.user-message .message-time {
    margin-right: 12px;
}

.ai-message .message-time {
    margin-left: 12px;
}

.controls {
    display: flex;
    justify-content: center;
    padding: 10px 0;
}

.record-button {
    width: 80%;
    max-width: 300px;
    padding: 15px 30px;
    font-size: 1.1em;
    color: rgb(46, 79, 79);
    background-color: rgba(17, 255, 0, 0.1);
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.record-button:hover {
    background-color: rgba(17, 255, 0, 0.2);
    transform: translateY(-2px);
}

.record-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.record-button.recording {
    color: rgb(255, 255, 255);
    background-color: #f57c00;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

/* Realtime 페이지 특화 스타일 */
.realtime-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
    padding-top: 60px;
    max-width: 1200px;
    margin: 0 auto;
}

.realtime-character-container {
    height: 70vh;
    width: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#live2d-canvas.realtime-canvas {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.realtime-controls {
    margin-top: 20px;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.realtime-controls .record-button {
    width: 300px;
    max-width: 90%;
    height: 50px;
    font-size: 1.2em;
}

#live2d-canvas.realtime-canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-height: 100%;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .left-panel {
        flex: none;
        height: 60vh;
    }

    .right-panel {
        flex: none;
        height: 40vh;
        max-width: 100%;
    }

    .chat-history {
        max-height: 40vh;
    }

    .message {
        max-width: 90%;
    }

    .realtime-character-container {
        height: 60vh;
    }

    .realtime-controls {
        margin-top: 10px;
    }
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

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

/* 페이지 제목 및 뒤로가기 버튼 */
.back-button {
    position: absolute;
    top: 20px;
    left: 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    color: #333;
    padding: 10px;
    transition: transform 0.2s ease;
    z-index: 1000;
}

.back-button:hover {
    transform: scale(1.1);
}

.page-title {
    margin-top: 60px;
    font-size: 1.8rem;
    color: #333;
    text-align: center;
}

.card.disabled {
    position: relative;
    pointer-events: none;
    cursor: default;
}

.coming-soon-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.coming-soon-overlay span {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 1.1em;
    font-weight: bold;
}
