:root {
    --bg-color-light: #f0f2f5;
    --text-color-light: #333;
    --card-bg-light: #ffffff;
    --primary-color: #4a90e2;
    --primary-hover-color: #357abd;
    --shadow-light: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-dark: 0 6px 15px rgba(0, 0, 0, 0.3);
    --border-radius: 12px;

    --bg-color-dark: #1a1a1a;
    --text-color-dark: #f0f2f5;
    --card-bg-dark: #2c2c2c;
    
    --font-family: 'Noto Sans KR', sans-serif;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color-light);
    color: var(--text-color-light);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
    background-image: subtle-noise-texture.png;
}

body.light-mode {
    --bg-color: var(--bg-color-light);
    --text-color: var(--text-color-light);
    --card-bg: var(--card-bg-light);
    --shadow: var(--shadow-light);
}

body:not(.light-mode) {
    --bg-color: var(--bg-color-dark);
    --text-color: var(--text-color-dark);
    --card-bg: var(--card-bg-dark);
    --shadow: var(--shadow-dark);
}

.app-container {
    background-color: var(--card-bg);
    padding: 30px 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 500px;
    text-align: center;
    transition: background-color 0.3s, box-shadow 0.3s;
    overflow: hidden; /* For step animations */
}

header h1 {
    font-size: 2em;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 30px;
}

/* Steps */
main {
    position: relative;
}

.step {
    display: none;
    animation: fadeOut 0.5s forwards;
}

.step.active {
    display: block;
    animation: fadeIn 0.7s forwards;
}

.step h2 {
    font-size: 1.5em;
    margin-bottom: 15px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-20px); }
}

/* Form Elements */
.input-field {
    width: 80%;
    padding: 12px;
    margin-top: 20px;
    margin-bottom: 30px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1em;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

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


/* Results */
#results-container {
    margin-top: 20px;
    margin-bottom: 30px;
}

.result-line {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    opacity: 0;
    transform: translateX(-20px);
    animation: slideIn 0.5s forwards;
}

.result-line-label {
    font-weight: bold;
    margin-right: 15px;
}

.number-set {
    display: flex;
    gap: 8px;
}

.number {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background-color: #f0f0f0;
    font-weight: bold;
    font-size: 1.1em;
    color: #333;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

@keyframes slideIn {
    to { opacity: 1; transform: translateX(0); }
}

/* Theme Toggle */
.theme-switch-container {
    position: absolute;
    top: 20px;
    right: 20px;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.theme-switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

footer {
    margin-top: 30px;
    opacity: 0.7;
    font-size: 0.9em;
}
