@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;700&display=swap');

:root {
    --main-bg-color: #f0f2f5;
    --card-bg-color: rgba(255, 255, 255, 0.6);
    --primary-color: #ff6b6b;
    --secondary-color: #48dbfb;
    --text-color: #333;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --border-radius: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--main-bg-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 네비게이션 & 헤더 */
header {
    background-color: var(--card-bg-color);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 a {
    font-size: 1.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 1rem;
}

.nav-menu a {
    text-decoration: none;
    color: #666;
    font-size: 0.9rem;
    font-weight: 700;
}

main {
    flex-grow: 1;
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.upload-section {
    background: var(--card-bg-color);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 32px 0 var(--shadow-color);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.image-placeholder {
    width: 100%;
    height: 300px;
    border: 2px dashed #ccc;
    border-radius: var(--border-radius);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.image-placeholder img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.image-placeholder #placeholder-text {
    color: #999;
    font-size: 1.1rem;
}

.upload-button, .analyze-button, .chemistry-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
    transition: all 0.3s ease;
}

.upload-button {
    background-color: var(--primary-color);
    color: white;
    margin-right: 1rem;
}

.upload-button:hover {
    background-color: #ff4757;
    transform: translateY(-2px);
}

input[type="file"] {
    display: none;
}

.analyze-button {
    background-color: var(--secondary-color);
    color: white;
}

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

.analyze-button:not(:disabled):hover {
    background-color: #00d2d3;
    transform: translateY(-2px);
}

.result-section, .chemistry-section {
    background: var(--card-bg-color);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 32px 0 var(--shadow-color);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 3rem;
    text-align: center;
}

.result-section h3, .chemistry-section h3 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.result-card {
    margin-bottom: 2rem;
}

.mbti-result {
    font-size: 4rem;
    font-weight: 700;
    color: var(--secondary-color);
    line-height: 1.2;
}

.mbti-description {
    font-size: 1.5rem;
    color: var(--text-color);
}

.report-section h4 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.model-result {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.model-result:last-child {
    border-bottom: none;
}

.model-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    color: var(--text-color);
}

.model-bar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.5rem;
}

.model-label {
    font-weight: 600;
    font-size: 0.9rem;
    width: 80px;
    text-align: center;
}

.model-label.left {
    color: var(--primary-color);
}

.model-label.right {
    color: var(--secondary-color);
}

.model-label span {
    display: block;
    font-size: 0.8rem;
    font-weight: 400;
    color: #666;
}

.progress-bar {
    flex-grow: 1;
    background-color: #eee;
    height: 20px;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.progress {
    position: absolute;
    top: 0;
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.5s ease-out, left 0.5s ease-out, right 0.5s ease-out;
}

.model-desc {
    font-size: 0.95rem;
    color: #555;
    background: rgba(255,255,255,0.5);
    padding: 0.8rem;
    border-radius: 8px;
    margin-top: 0.5rem;
    line-height: 1.4;
}

.feedback-section {
    margin: 2rem 0;
    padding: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.feedback-section p {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.feedback-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.feedback-btn {
    padding: 0.8rem 2rem;
    border-radius: 50px;
    border: 2px solid #ddd;
    background: white;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
}

.feedback-btn.yes-btn:hover, .feedback-btn.yes-btn.active {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.feedback-btn.no-btn:hover, .feedback-btn.no-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.chemistry-upload {
    display: flex;
    justify-content: space-around;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.upload-box {
    border: 2px dashed #ddd;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    flex: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.4);
}

.upload-box:hover {
    border-color: var(--secondary-color);
    background: rgba(255, 255, 255, 0.8);
}

.upload-box p {
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.chem-preview-container {
    width: 100%;
    aspect-ratio: 1/1;
    background: #f9f9f9;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.chem-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-icon {
    font-size: 2rem;
    color: #ccc;
}

.chemistry-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.chemistry-result {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px dashed rgba(0, 0, 0, 0.1);
}

.chem-result-card {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 2rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.chem-score-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: var(--primary-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    flex-shrink: 0;
}

#chem-score {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
}

.chem-score-circle small {
    font-size: 0.8rem;
    font-weight: 700;
}

.chem-info {
    text-align: left;
}

.chem-mbtis {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.chem-desc {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.4;
}

/* AdSense 최적화용 추가 스타일 */
.adsense-info, .adsense-policy {
    margin-top: 4rem;
}

.info-card, .policy-card {
    background: #fff;
    padding: 2rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px var(--shadow-color);
    border: 1px solid #eee;
}

.info-card h3, .adsense-policy h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.info-card p, .policy-card p {
    margin-bottom: 1rem;
    color: #555;
    font-size: 1rem;
}

.info-list {
    list-style: none;
    padding-left: 0;
}

.info-list li {
    padding: 0.8rem;
    background: #fdfdfd;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    border-left: 4px solid var(--secondary-color);
}

footer {
    text-align: center;
    padding: 3rem 1.5rem;
    margin-top: 4rem;
    font-size: 0.9rem;
    color: #fff;
    background: #333;
}

footer a { color: var(--secondary-color); text-decoration: none; }

@media (max-width: 768px) {
    .nav-menu { display: none; }
    .chemistry-upload {
        flex-direction: row; /* 가로 유지 */
        gap: 0.5rem;
    }

    .upload-box {
        padding: 1rem 0.5rem;
    }

    .upload-box p {
        font-size: 0.9rem;
    }
    
    .chem-result-card {
        flex-direction: column;
        text-align: center;
    }
    
    .chem-info {
        text-align: center;
    }

    main {
        padding: 1rem;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .upload-section, .result-section, .chemistry-section {
        padding: 1.5rem;
    }

    .upload-button, .analyze-button, .chemistry-button {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .upload-button {
        margin-right: 0;
    }
}
