:root {
    --bg-color: #F8F9FA; /* Off-white almost grey */
    --text-color: #1A1A1A; /* Dark almost black for general text */
    --brand-color: #0000FF; /* Pure blue */
    --brand-faded: rgba(0, 0, 255, 0.1);
    --border-light: #E9ECEF;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', 'Noto Sans KR', sans-serif;
    line-height: 1.5;
    font-size: 14px;
    overflow-x: hidden;
}

/* Layout */
.wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 5%;
}

.app-header {
    padding: 3rem 0;
}
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.nav-title {
    color: var(--brand-color);
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: -0.02em;
}
.breadcrumbs {
    color: var(--brand-color);
    font-size: 0.9rem;
}

.app-container {
    padding-bottom: 5rem;
}

/* Typography elements */
h2 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--brand-color);
    margin-bottom: 0.25rem;
}
h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
p {
    font-size: 0.95rem;
    color: var(--text-color);
}
.highlight-text {
    font-size: 1.25rem;
    color: var(--brand-color);
    font-weight: 500;
}

.section-header {
    margin-bottom: 3rem;
}

/* SPA Logic */
.view { display: none; }
.view.active { display: block; animation: fadeIn 0.4s ease; }
@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Components */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}
.menu-card {
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    padding: 1rem 0;
}
.menu-card h3 { color: var(--brand-color); }
.menu-card:hover h3 { text-decoration: underline; }

.list-container {
    display: grid;
    gap: 1rem;
    margin-bottom: 3rem;
}
.theme-item {
    cursor: pointer;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light);
}
.theme-item:hover .theme-title { color: var(--brand-color); }

.split-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.radio-item {
    cursor: pointer;
}
.radio-item input { display: none; }
.radio-label {
    display: block;
    padding: 1rem;
    background: white;
    border: 1px solid var(--border-light);
    color: var(--text-color);
    transition: all 0.2s;
    font-size: 0.95rem;
}
.radio-item:hover .radio-label {
    border-color: var(--brand-color);
}
.radio-item input:checked + .radio-label {
    background: var(--brand-color);
    color: white;
    border-color: var(--brand-color);
}

/* Upgraded Stats (Gauges) */
.visual-stats-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 4rem;
}
.visual-stat {
    text-align: center;
}
.circle-gauge {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    margin: 0 auto 1.5rem auto;
    /* Background gradients are updated via JS */
    background: conic-gradient(var(--brand-color) 0deg, var(--border-light) 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
}
.circle-gauge::before {
    content: "";
    position: absolute;
    inset: 12%; /* thickness of the donut */
    border-radius: 50%;
    background: var(--bg-color);
}
.circle-gauge .percentage {
    position: relative;
    z-index: 1;
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--brand-color);
}
.visual-stat h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--brand-color);
}
.visual-stat p {
    font-size: 0.85rem;
    opacity: 0.8;
}

.keywords-list { margin-bottom: 3rem; }
.cloud span {
    display: inline-block;
    padding: 4px 0;
    margin-right: 1.5rem;
    color: var(--brand-color);
}

/* Action Bars & Buttons */
.action-bar {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
}
.multi-actions {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.text-btn {
    background: none;
    border: none;
    color: var(--brand-color);
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
}
.text-btn:hover {
    text-decoration: underline;
}
.right-align {
    margin-left: auto;
}
.text-btn.hidden { display: none; }
.inline-btn {
    background: none;
    border: none;
    color: var(--brand-color);
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.85rem;
}
.inline-link {
    color: var(--brand-color);
    text-decoration: none;
}
.inline-link:hover { text-decoration: underline; }

/* Result lists */
.final-result-layout {
    display: grid;
    gap: 2.5rem;
    margin-bottom: 2rem;
}
.result-block h3 {
    color: var(--brand-color);
    border-bottom: 1px solid var(--brand-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}
.clean-list { list-style: none; }
.clean-list li { margin-bottom: 0.4rem; font-size: 0.95rem; }

/* Forms & Uploads */
.file-drop-zone {
    border: 1px dashed var(--brand-color);
    padding: 4rem 2rem;
    text-align: center;
    color: var(--brand-color);
    cursor: pointer;
    margin-bottom: 2rem;
}
.file-drop-zone:hover { background: var(--brand-faded); }

#upload-preview img {
    max-width: 100%;
    max-height: 300px;
}

.data-section {
    margin-bottom: 2.5rem;
}
.section-head {
    display: flex; justify-content: space-between; align-items: baseline;
    border-bottom: 1px solid var(--brand-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}
.section-head h3 { color: var(--brand-color); margin: 0;}
.guide-text { margin-bottom: 1rem; font-size: 0.85rem;}
.data-content p { margin-bottom: 0.5rem;}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.tag-item {
    border: 1px solid var(--border-light);
    color: var(--text-color);
    padding: 4px 12px;
    cursor: pointer;
    font-size: 0.9rem;
}
.tag-item:hover { border-color: var(--brand-color); }
.tag-item.selected {
    background: var(--brand-color);
    color: white;
    border-color: var(--brand-color);
}

.clean-form .form-row { margin-bottom: 1.5rem; }
.clean-form label {
    display: block;
    color: var(--brand-color);
    font-weight: 500;
    margin-bottom: 0.5rem;
}
.clean-form input, .clean-form textarea {
    width: 100%;
    border: none;
    border-bottom: 1px solid var(--border-light);
    background: transparent;
    font-family: inherit;
    font-size: 1rem;
    padding: 0.5rem 0;
    color: var(--text-color);
}
.clean-form input:focus, .clean-form textarea:focus {
    outline: none;
    border-bottom-color: var(--brand-color);
}

/* Document Result */
.text-document { margin-bottom: 2rem; }
.text-document pre {
    white-space: pre-wrap;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--text-color);
}

.center-message {
    text-align: center;
    padding: 5rem 0;
    color: var(--brand-color);
}

.app-footer {
    padding: 2rem 5%;
    border-top: 1px solid var(--border-light);
    color: var(--text-color);
    font-size: 0.85rem;
    max-width: 900px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .menu-grid, .visual-stats-container, .split-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}
