/* Google Fonts (Noto Sans KR) 불러오기 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700&display=swap');

body {
    font-family: 'Noto Sans KR', sans-serif; /* 새로운 폰트 적용 */
    background-color: #f7f8fa; /* 더 밝고 깔끔한 배경색 */
    color: #333;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

#app-container, .community-post {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 16px; /* 더 부드러운 모서리 */
    border: 1px solid #eef0f3;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); /* 더 은은한 그림자 */
    width: 100%;
    max-width: 700px;
    text-align: center;
    margin-top: 20px;
    margin-bottom: 20px;
}

/* 제목 스타일 수정 */
h1 {
    color: #2c3e50; /* 차분한 네이비 색상 */
    font-size: 2.2em;
    font-weight: 700;
}
h2 {
    font-size: 1.5em;
    margin: 0 0 10px 0;
    text-align: left;
    font-weight: 700;
    color: #2c3e50;
}
h3 {
    color: #34495e;
    margin-top: 0;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 20px;
    font-size: 1.4em;
    font-weight: 500;
}

/* 버튼 스타일 수정 */
.upload-label {
    background-color: #3498db; /* 산뜻한 파란색 */
    color: white;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-block;
    font-weight: 500;
    transition: background-color 0.2s;
    border: none;
    font-size: 16px;
    text-align: center;
}
.upload-label:hover { background-color: #2980b9; }
.upload-label.secondary { 
    background-color: #95a5a6;
    margin-top: 15px;
}
.upload-label.secondary:hover { background-color: #7f8c8d; }

input[type="file"] { display: none; }
#image-preview { max-width: 100%; max-height: 400px; border-radius: 12px; margin-bottom: 20px; border: 1px solid #eee; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 결과 섹션 스타일 수정 */
.result-section {
    text-align: left;
    background-color: transparent; /* 배경색 제거 */
    padding: 0;
    border: none; /* 테두리 제거 */
    border-bottom: 1px solid #f0f0f0; /* 각 섹션 구분을 위한 하단선 */
    line-height: 1.8;
    margin-bottom: 25px;
    padding-bottom: 25px;
    animation: fadeIn 0.5s ease-in-out forwards;
    opacity: 0;
}
/* 마지막 섹션의 하단선은 제거 */
.result-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.result-section h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 1.1em;
    font-weight: 700;
}
.result-section p { margin: 0 0 12px 0; font-size: 1em; color: #555; }

/* AI 한줄평 섹션 디자인 수정 */
#verdict-section {
    text-align: left;
    border-left: 4px solid #3498db; /* 왼쪽 강조선 */
    padding: 10px 0 10px 20px;
    background-color: transparent;
    margin-bottom: 30px;
    border-bottom: none;
}
#verdict-section h4 { font-size: 1em; color: #555; font-weight: 500; }
#verdict-section p { font-size: 1.2em; color: #34495e; font-weight: 700; margin:0;}
#verdict-section p:first-of-type { margin-bottom: 10px; }

.car-candidate { border-bottom: 1px dashed #ddd; padding-bottom: 15px; margin-bottom: 15px; }
.car-candidate:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.chart-container { position: relative; height: auto; width: 100%; max-width: 450px; margin: 0 auto; }
#reset-button { margin-top: 20px; }

#loader-wrapper { text-align: center; }
.loader { border: 5px solid #f3f3f3; border-top: 5px solid #3498db; border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: 20px auto; }
#loading-text { font-size: 1em; color: #555; }
#error-section img { max-width: 120px; margin-bottom: 15px; opacity: 0.8; }

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* 메인 페이지 스타일 */
.community-post { text-align: left; }
.post-header { border-bottom: 1px solid #f0f0f0; padding-bottom: 15px; margin-bottom: 15px; }
.post-meta { font-size: 0.9em; color: #888; }
.post-meta span { margin-right: 15px; }
.post-body img { max-width: 100%; border-radius: 12px; margin-bottom: 15px; }
.post-body p { text-align: left; }

.post-comments { margin-top: 20px; padding-top: 10px; border-top: 1px solid #f0f0f0; }
.comment { padding: 15px 5px; border-bottom: 1px solid #f0f0f0; background-color: transparent; }
.comment:last-child { border-bottom: none; }
.author-comment b { color: #3498db; }
.reply { padding-left: 25px; position: relative; }
.reply::before { content: '↳'; position: absolute; left: 5px; top: 15px; color: #888; font-weight: bold; }
#start-analysis-button { width: 100%; margin-top: 30px; padding: 15px; font-size: 1.2em; }

/* 반응형 미디어 쿼리 */
@media (max-width: 768px) {
    body { padding: 10px; }
    #app-container, .community-post { padding: 20px; margin-top: 10px; margin-bottom: 10px; }
    h1 { font-size: 28px; }
    .result-section h3 { font-size: 20px; }
    .result-section p, .result-section h4 { font-size: 15px; }
}
@media (max-width: 480px) {
    #app-container, .community-post { padding: 15px; }
    h1 { font-size: 24px; }
    h2 { font-size: 1.2em; }
    .upload-label, #reset-button, #start-analysis-button { padding: 12px 16px; font-size: 1em; }
}