/* 전체 리셋 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #f5f5f5;
    color: #222;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 최대 너비 제한 */
body {
    max-width: 390px;
    margin: 0 auto;
    background-color: #ffffff;
}

/* ========== 리뷰 리스트 미리보기 ========== */
.review-list-preview {
    background-color: #ffffff;
    padding: 0;
}

.review-preview-image {
    width: 100%;
    overflow: hidden;
}

.review-preview-image img {
    width: 100%;
    display: block;
}

/* ========== 챗봇 섹션 ========== */
.chatbot-section {
    background-color: #ffffff;
    padding: 20px;
    border-top: 1px solid #e8e8e8;
}

.chatbot-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* 타이틀 영역 */
.chatbot-title-area {
    margin-bottom: 12px;
}

.chatbot-title {
    font-size: 16px;
    font-weight: 700;
    color: #222;
}

/* Qoo10 봇 메시지 */
.bot-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.bot-avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.bot-bubble {
    background-color: #f5f5f5;
    border: 1px solid #e8e8e8;
    border-radius: 4px 16px 16px 16px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 400;
    color: #333;
    line-height: 1.5;
    max-width: 75%;
}

/* 추천 질문 - 오른쪽 정렬, 1줄에 1개씩 */
.quick-questions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    margin-bottom: 12px;
}

.quick-question-item {
    background-color: #ffffff;
    border: 1px solid #5cb7e7;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #5cb7e7;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.quick-question-item:hover {
    background-color: #5cb7e7;
    color: #ffffff;
    transform: translateY(-1px);
}

.quick-question-item:active {
    transform: translateY(0);
}

.quick-question-item.used {
    opacity: 0.4;
    pointer-events: none;
}

/* 대화 영역 */
.conversation-area {
    min-height: 0;
    max-height: 500px;
    overflow-y: auto;
    padding: 0;
    margin-bottom: 0;
}

/* 사용자 메시지 */
.user-message {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
    margin-top: 12px;
    animation: slideInFromRight 0.3s ease;
}

.user-bubble {
    background-color: #5cb7e7;
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 16px 16px 4px 16px;
    max-width: 75%;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    box-shadow: 0 2px 6px rgba(92, 183, 231, 0.2);
    word-break: keep-all;
}

/* AI 메시지 */
.ai-message {
    margin-bottom: 20px;
    animation: slideInFromLeft 0.3s ease;
}

.ai-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.ai-avatar {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    background-color: #f0f0f0;
}

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

.ai-label {
    font-size: 11px;
    font-weight: 600;
    color: #888;
}

.ai-bubble {
    background-color: #f5f5f5;
    border: 1px solid #e8e8e8;
    padding: 16px;
    border-radius: 4px 16px 16px 16px;
    font-size: 14px;
    line-height: 1.7;
    color: #333;
    white-space: pre-line;
    margin-bottom: 14px;
    margin-left: 34px;
}

/* 근거 리뷰 섹션 */
.evidence-section {
    margin-top: 12px;
    margin-left: 34px;
    animation: fadeInUp 0.4s ease;
}

.evidence-header {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.evidence-icon {
    font-size: 14px;
}

.evidence-reviews {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.evidence-review-card {
    background-color: #ffffff;
    border: 1px solid #e8e9eb;
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.evidence-review-card:hover {
    border-color: #5cb7e7;
    box-shadow: 0 4px 12px rgba(92, 183, 231, 0.15);
    transform: translateY(-2px);
}

.evidence-review-rating {
    font-size: 12px;
    color: #ffa500;
    margin-bottom: 6px;
    font-weight: 600;
}

.evidence-review-content {
    font-size: 13px;
    line-height: 1.6;
    color: #444;
    margin-bottom: 8px;
}

.evidence-review-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #999;
}

.evidence-tag {
    padding: 3px 8px;
    background-color: #f0f1f3;
    border-radius: 4px;
    font-size: 10px;
    color: #666;
    font-weight: 500;
}

/* 더보기 버튼 */
.view-more-button {
    width: 100%;
    padding: 12px;
    background-color: #ffffff;
    border: 1.5px solid #5cb7e7;
    border-radius: 10px;
    color: #5cb7e7;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-more-button:hover {
    background-color: #5cb7e7;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(92, 183, 231, 0.2);
}

/* 로딩 애니메이션 */
.loading-message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 0;
    animation: slideInFromLeft 0.3s ease;
}

.loading-dots {
    display: flex;
    gap: 5px;
    padding: 12px 16px;
    background-color: #f5f5f5;
    border: 1px solid #e8e8e8;
    border-radius: 4px 16px 16px 16px;
    margin-left: 34px;
}

.loading-dot {
    width: 8px;
    height: 8px;
    background-color: #5cb7e7;
    border-radius: 50%;
    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; }
.loading-dot:nth-child(3) { animation-delay: 0s; }

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 질문 입력 영역 */
.input-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    transition: all 0.2s ease;
    margin-top: 0;
}

.input-container:focus-within {
    border-color: #5cb7e7;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(92, 183, 231, 0.1);
}

.question-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    font-family: 'Noto Sans KR', sans-serif;
    color: #222;
    padding: 2px 0;
}

.question-input::placeholder {
    color: #999;
}

.send-button {
    width: 36px;
    height: 36px;
    background-color: #5cb7e7;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ffffff;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.send-button:hover {
    background-color: #4aa3d3;
    transform: scale(1.05);
}

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

.send-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: scale(1);
}

/* 애니메이션 */
@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

/* 스크롤바 스타일 */
.conversation-area::-webkit-scrollbar {
    width: 6px;
}

.conversation-area::-webkit-scrollbar-track {
    background: transparent;
}

.conversation-area::-webkit-scrollbar-thumb {
    background-color: #d0d0d0;
    border-radius: 3px;
}

.conversation-area::-webkit-scrollbar-thumb:hover {
    background-color: #b0b0b0;
}

/* 반응형 */
@media (max-width: 390px) {
    .chatbot-section {
        padding: 16px;
    }

    .chatbot-title {
        font-size: 15px;
    }

    .bot-bubble {
        font-size: 13px;
    }

    .quick-question-item {
        font-size: 12px;
        padding: 7px 14px;
    }
}
