:root {
    --primary-color: #4A90E2; /* A friendly blue */
    --secondary-color: #f4f7f6; /* Light grey for backgrounds */
    --text-color: #333333;
    --heading-color: #2c3e50; /* Darker blue-grey for headings */
    --accent-color: #FFC107; /* A bright yellow for highlights */
    --white-color: #ffffff;
    --border-radius: 10px;
    --shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    --transition-speed: 0.3s;
}

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

body {
    font-family: 'Noto Sans KR', sans-serif; /* Korean font support */
    background-color: var(--secondary-color);
    color: var(--text-color);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

a:hover {
    color: var(--heading-color);
}

.hidden {
    display: none !important;
}

/* Navbar */
.navbar {
    background-color: var(--white-color);
    box-shadow: var(--shadow);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

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

.nav-logo {
    color: var(--primary-color);
    font-size: 1.6rem;
    font-weight: 700;
}

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

.nav-link {
    color: var(--heading-color);
    font-weight: 500;
    padding: 0.5rem 0;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width var(--transition-speed) ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Page Sections */
.page-section {
    padding: 8rem 2rem 4rem; /* Adjusted for fixed navbar */
    max-width: 1200px;
    margin: 0 auto;
}

.section-container {
    max-width: 900px;
    margin: 0 auto;
}

.section-title {
    font-size: 2.5rem;
    color: var(--heading-color);
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -10px;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, #6dd5ed 100%);
    color: var(--white-color);
    text-align: center;
    padding: 10rem 2rem 6rem;
    border-radius: 0 0 50% 50% / 10%;
    transform: translateY(-20px);
    opacity: 0;
    animation: fade-in-up 0.8s forwards 0.2s;
}

@keyframes fade-in-up {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.hero .subtitle {
    font-size: 1.4rem;
    opacity: 0.9;
    margin-bottom: 2.5rem;
}

.upload-area {
    margin-top: 2rem;
}

.upload-label {
    display: inline-block;
    padding: 1.2rem 3.5rem;
    font-size: 1.3rem;
    font-weight: 700;
    background-color: var(--accent-color);
    color: var(--heading-color);
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    box-shadow: var(--shadow);
    border: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.upload-label:hover {
    background-color: #ffda6a;
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.disclaimer {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
}

/* Analyzing State */
#analyzing-container {
    text-align: center;
    padding: 3rem 2rem;
    background-color: var(--white-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

#analyzing-container h2 {
    color: var(--heading-color);
    font-size: 1.8rem;
    margin-bottom: 2rem;
}

.progress-bar-container {
    width: 80%;
    max-width: 500px;
    background-color: var(--secondary-color);
    border-radius: 50px;
    height: 20px;
    margin: 0 auto 1.5rem;
    overflow: hidden;
}

#progress-bar {
    height: 100%;
    width: 0;
    background-color: var(--primary-color);
    border-radius: 50px;
    transition: width 0.4s ease-in-out;
}

.progress-text {
    font-size: 1.1rem;
    color: var(--text-color);
    min-height: 25px; /* Prevent layout shift */
}

/* Analysis Report */
#analysis-result-container {
    padding: 3rem 2rem;
    background-color: var(--white-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

#analysis-result-container h2 {
    text-align: center;
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 2.5rem;
    position: relative;
}

#analysis-result-container h2::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -10px;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--accent-color);
    border-radius: 2px;
}


.report-layout {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.report-left {
    text-align: center;
    flex-basis: 30%;
}

#image-preview {
    width: 100%;
    max-width: 280px;
    height: auto;
    border-radius: var(--border-radius);
    border: 5px solid var(--primary-color);
    box-shadow: var(--shadow);
}

.summary-box {
    background-color: var(--secondary-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-top: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.summary-box h3 {
    color: var(--heading-color);
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.summary-box p {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--primary-color);
}

.report-right {
    flex-basis: 70%;
}

#detailed-analysis h3 {
    font-size: 1.8rem;
    color: var(--heading-color);
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.report-section {
    margin-bottom: 2.5rem;
}

.report-section h4 {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.trait-score {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.trait-score span {
    font-weight: 600;
    width: 100px; /* Fixed width for trait name */
    min-width: 100px;
    color: var(--heading-color);
}

.score-bar-bg {
    flex-grow: 1;
    height: 10px;
    background-color: var(--secondary-color);
    border-radius: 5px;
    margin-left: 1rem;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    background-color: var(--accent-color);
    border-radius: 5px;
    width: 0; /* Animated with JS */
    transition: width 1.5s ease-out;
}

/* Insights Section */
#insights {
    background-color: var(--secondary-color);
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.article-card {
    background-color: var(--white-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    display: block;
}

.article-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.article-card h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.article-card p {
    color: var(--text-color);
    font-size: 1rem;
    line-height: 1.6;
}

/* Article Pages */
.article-page {
    background-color: var(--white-color);
    padding-top: 6rem;
}

.article-content {
    padding: 3rem;
    background-color: var(--white-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.article-content h2 {
    font-size: 2.2rem;
    color: var(--heading-color);
    margin-bottom: 1.5rem;
}

.article-content h4 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.article-content p {
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

.back-link {
    display: inline-block;
    margin-bottom: 2rem;
    color: var(--primary-color);
    font-weight: 500;
}

/* Info Sections (About, Privacy) */
.info-section {
    background-color: var(--white-color);
    padding-top: 6rem;
}

.info-section h2 {
    color: var(--heading-color);
    margin-bottom: 1.5rem;
}

.info-section strong {
    color: var(--primary-color);
}

/* Contact Form */
.contact-form {
    margin-top: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 600;
    color: var(--heading-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.25);
    outline: none;
}

.form-group textarea {
    resize: vertical;
}

.submit-btn {
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 1.2rem 2.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
    transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.submit-btn:hover {
    background-color: var(--heading-color);
    transform: translateY(-2px);
}

/* Footer */
.footer {
    background-color: var(--heading-color);
    color: rgba(255,255,255,0.8);
    text-align: center;
    padding: 3rem 2rem;
    margin-top: 4rem;
}

.footer-nav {
    margin-bottom: 1.5rem;
}

.footer-nav a {
    color: rgba(255,255,255,0.8);
    margin: 0 1rem;
    transition: color var(--transition-speed) ease;
}

.footer-nav a:hover {
    color: var(--primary-color);
}

.footer-disclaimer {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .nav-menu {
        flex-direction: column;
        gap: 1rem;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--white-color);
        box-shadow: 0 5px 15px rgba(0,0,0,0.05);
        padding: 1rem 2rem;
        display: none; /* Hidden by default for mobile */
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-container {
        padding: 1rem 1.5rem;
    }

    .nav-logo {
        font-size: 1.4rem;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero .subtitle {
        font-size: 1.1rem;
    }

    .upload-label {
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .report-layout {
        flex-direction: column;
    }

    .report-left, .report-right {
        flex-basis: 100%;
    }

    #image-preview {
        max-width: 200px;
    }

    .article-grid {
        grid-template-columns: 1fr;
    }
}
