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

:root {
    --background-color: #f8f9fa;
    --card-background-color: #ffffff;
    --text-color: #212529;
    --primary-color: #007bff;
    --border-color: #dee2e6;
    --max-width: 768px;
    --border-radius: 8px;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding-top: 80px; /* Add padding to body to avoid overlap with fixed navbar */
    display: flex;
    justify-content: center;
}

/* --- Navigation Bar --- */
.navbar {
    background-color: var(--card-background-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.navbar-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.nav-logo a {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-color);
    text-decoration: none;
}

.nav-menu a {
    color: #6c757d;
    text-decoration: none;
    margin-left: 1.5rem;
    font-size: 1rem;
    font-weight: 500;
}

.nav-menu a:hover, .nav-menu a.active {
    color: var(--primary-color);
}


.container {
    width: 100%;
    max-width: var(--max-width);
    text-align: center;
    padding: 2rem 1rem;
}

header {
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.1rem;
    color: #6c757d;
}

.card {
    background-color: var(--card-background-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    text-align: left;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Section for additional info */
.info-section {
    margin-top: 2rem;
    padding: 1.5rem;
}

.info-section h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    display: inline-block;
}

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

.info-section ul li {
    margin-bottom: 0.75rem;
    color: #495057;
}

.info-section ul li strong {
    color: var(--text-color);
}

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

.tab-group {
    display: inline-flex;
    gap: 0.5rem;
    padding: 0.35rem;
    border-radius: 999px;
    background-color: #f1f3f5;
    margin-bottom: 1.25rem;
}

.tab-button {
    border: none;
    background: transparent;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    color: #6c757d;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.tab-button.active {
    background-color: #ffffff;
    color: var(--primary-color);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    box-sizing: border-box; /* Ensures padding doesn't affect width */
    font-family: 'Noto Sans KR', sans-serif;
}

button#calculate-btn, button[type="submit"] {
    width: 100%;
    padding: 0.85rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    background-color: var(--primary-color);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.2s;
}

button#calculate-btn:hover, button[type="submit"]:hover {
    background-color: #0056b3;
}

.result-card {
    text-align: center;
}

.result-card h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.result-item span {
    font-size: 1.1rem;
}

.result-item strong {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.accordion {
    margin-top: 1.5rem;
    text-align: left;
}

.accordion-item {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    background-color: var(--card-background-color);
    margin-top: 0.75rem;
}

.accordion-item summary {
    list-style: none;
    cursor: pointer;
    padding: 1rem 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.accordion-item summary::-webkit-details-marker {
    display: none;
}

.accordion-item summary::after {
    content: "+";
    font-size: 1.2rem;
    color: #6c757d;
}

.accordion-item[open] summary::after {
    content: "-";
}

.accordion-item[open] summary {
    border-bottom: 1px solid var(--border-color);
}

.accordion-content {
    padding: 1rem 1.25rem 1.25rem;
}

.percentile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.percentile-card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    text-align: center;
    background-color: #f8fbff;
}

.percentile-card strong {
    display: block;
    margin-top: 0.35rem;
    font-size: 1.6rem;
    color: var(--primary-color);
}

.percentile-subtext {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.input-group.compact {
    margin-bottom: 1rem;
}

.note {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

.disclaimer {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 2rem;
}

footer {
    margin-top: 3rem;
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
}

footer a {
    color: #6c757d;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

footer .separator {
    margin: 0 0.5rem;
    color: #adb5bd;
}

@media (max-width: 640px) {
    .percentile-grid {
        grid-template-columns: 1fr;
    }

}
