:root {
    --bg-color-light: #f0f2f5;
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
    --text-color-primary: #333;
    --text-color-secondary: #666;
    --container-bg-color: rgba(255, 255, 255, 0.9);
    --button-bg-color: #764ba2;
    --button-hover-bg-color: #663a82;
    --button-shadow-color: rgba(118, 75, 162, 0.4);
    --button-hover-shadow-color: rgba(118, 75, 162, 0.5);
    --ball-text-color: #fff;
    --app-title-color: #333;
}

.dark-mode {
    --bg-color-light: #1a1a1a;
    --bg-gradient-start: #2c3e50;
    --bg-gradient-end: #4b6cb7;
    --text-color-primary: #f0f2f5;
    --text-color-secondary: #aaa;
    --container-bg-color: rgba(44, 62, 80, 0.9);
    --button-bg-color: #4b6cb7;
    --button-hover-bg-color: #3a539b;
    --button-shadow-color: rgba(75, 108, 183, 0.4);
    --button-hover-shadow-color: rgba(75, 108, 183, 0.5);
    --ball-text-color: #fff;
    --app-title-color: #f0f2f5;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--bg-color-light);
    background-image: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: var(--text-color-primary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    transition: background-color 0.3s, color 0.3s;
    padding-top: 80px; /* Add padding for the fixed header */
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 800"><g fill-opacity="0.2"><circle fill="%23ffffff" cx="400" cy="400" r="600"/><circle fill="%23f0f2f5" cx="400" cy="400" r="500"/><circle fill="%23e0e2e5" cx="400" cy="400" r="400"/><circle fill="%23d0d2d5" cx="400" cy="400" r="300"/><circle fill="%23c0c2c5" cx="400" cy="400" r="200"/><circle fill="%23b0b2b5" cx="400" cy="400" r="100"/></g></svg>');
    opacity: 0.05;
    pointer-events: none;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--container-bg-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.site-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 0;
    padding: 1rem 0;
}

.site-nav a {
    text-decoration: none;
    color: var(--text-color-primary);
    font-weight: 600;
    font-size: 1.1rem;
    transition: color 0.3s;
}

.site-nav a:hover {
    color: var(--button-bg-color);
}

.app-container, .content-section, .form-section {
    margin-top: 2rem;
    margin-bottom: 2rem;
    background-color: var(--container-bg-color);
    padding: 2.5rem 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);
    width: 90%;
    max-width: 500px;
    backdrop-filter: blur(10px);
}

.app-container {
    text-align: center;
    position: relative;
}

.theme-switcher-container {
    position: absolute;
    top: 20px;
    right: 20px;
}

.theme-switcher {
    appearance: none;
    width: 50px;
    height: 26px;
    background-color: #ccc;
    border-radius: 13px;
    position: relative;
    cursor: pointer;
    outline: none;
    transition: background-color 0.3s;
}

.theme-switcher::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.theme-switcher:checked {
    background-color: var(--button-bg-color);
}

.theme-switcher:checked::before {
    transform: translateX(24px);
}

.app-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--app-title-color);
    margin: 0 0 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.app-icon {
    font-size: 2.5rem;
}

.app-description {
    font-size: 1rem;
    color: var(--text-color-secondary);
    margin: 0 0 2rem;
}

.numbers-display {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    min-height: 50px;
}

.number-ball {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--ball-text-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    animation: pop-in 0.3s ease-out forwards;
}

.generate-btn {
    background-color: var(--button-bg-color);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s;
    box-shadow: 0 4px 15px var(--button-shadow-color);
}

.generate-btn:hover {
    background-color: var(--button-hover-bg-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--button-hover-shadow-color);
}

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

.form-description {
    font-size: 0.9rem;
    color: var(--text-color-secondary);
    margin-bottom: 2rem;
}

.story-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    text-align: left;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 1rem;
    color: var(--text-color-primary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
    color: var(--text-color-primary);
    background-color: rgba(255,255,255,0.5);
    transition: border-color 0.3s, background-color 0.3s;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group textarea:focus {
    border-color: var(--button-bg-color);
    outline: none;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.story-form .submit-btn {
    align-self: center;
    width: auto;
    min-width: 150px;
}

#disqus_thread {
    margin-top: 2rem;
    background-color: var(--container-bg-color);
    padding: 2.5rem 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);
    width: 90%;
    max-width: 500px;
    backdrop-filter: blur(10px);
}

.site-footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-color-secondary);
    width: 100%;
}

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

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


@keyframes pop-in {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Styles */
@media (max-width: 480px) {
    .app-container, .content-section, .form-section, #disqus_thread {
        padding: 2rem 1.5rem;
    }

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

    .app-icon {
        font-size: 2rem;
    }

    .number-ball {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }

    .form-title {
        font-size: 1.5rem;
    }
}