:root {
    --background-color: #121212;
    --surface-color: #1E1E1E;
    --primary-color: #BB86FC;
    --primary-glow: rgba(187, 134, 252, 0.5);
    --text-color: #FFFFFF;
    --text-secondary-color: #B3B3B3;
    --ball-color: #2C2C2C;
    --ball-shadow: 0 10px 20px rgba(0, 0, 0, 0.3), 0 6px 6px rgba(0, 0, 0, 0.25);
    --toggle-bg: #2C2C2C;
    --bg-pattern: #2a2a2a;
}

body.light-mode {
    --background-color: #F8F9FA;
    --surface-color: #FFFFFF;
    --primary-color: #6200EE;
    --primary-glow: rgba(98, 0, 238, 0.3);
    --text-color: #212121;
    --text-secondary-color: #666666;
    --ball-color: #F0F0F0;
    --ball-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    --toggle-bg: #E0E0E0;
    --bg-pattern: #e0e0e0;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    transition: background-color 0.4s ease, color 0.4s ease;
    background-image: url('data:image/svg+xml,%3Csvg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath d="M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63-17c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 60c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3z" fill="%232a2a2a" fill-opacity="0.2" fill-rule="evenodd"/%3E%3C/svg%3E');
}

/* Update pattern color dynamically isn't easy with data-uri, but we can use an overlay or just accept the dark pattern */

.container {
    position: relative;
    text-align: center;
    background-color: var(--surface-color);
    padding: 60px 30px 40px; /* Increased top padding for nav */
    border-radius: 15px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    max-width: 600px;
    width: 95%;
    transition: background-color 0.4s ease, box-shadow 0.4s ease;
}

.main-nav {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 15px;
}

.nav-link {
    color: var(--text-secondary-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 5px;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color);
    background-color: var(--toggle-bg);
}

#theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background-color: var(--toggle-bg);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    transition: transform 0.3s ease, background-color 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#theme-toggle:hover {
    transform: rotate(20deg) scale(1.1);
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-secondary-color);
    margin-bottom: 30px;
    font-size: 1rem;
}

.numbers-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    min-height: 100px;
}

.number-row {
    display: flex;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--ball-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-color);
    box-shadow: var(--ball-shadow);
    opacity: 0;
    transform: scale(0.5);
    animation: reveal 0.5s forwards ease-out;
}

@keyframes reveal {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#generate-btn {
    margin-top: 40px;
    padding: 15px 35px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    border-radius: 50px;
    background-color: var(--primary-color);
    color: var(--surface-color);
    box-shadow: 0 0 15px var(--primary-glow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#generate-btn:hover, #generate-btn:focus {
    transform: translateY(-3px);
    box-shadow: 0 0 25px var(--primary-glow);
    outline: none;
}

#generate-btn:active {
    transform: translateY(0);
}

.contact-section {
    margin-top: 50px;
    padding-top: 20px;
}

.divider {
    border: none;
    border-top: 1px solid var(--toggle-bg);
    margin-bottom: 30px;
}

.contact-section h3 {
    margin-bottom: 10px;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.contact-desc {
    color: var(--text-secondary-color);
    font-size: 0.9rem;
    margin-bottom: 25px;
}

#contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid var(--toggle-bg);
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 8px var(--primary-glow);
}

.submit-btn {
    padding: 12px;
    border-radius: 8px;
    border: none;
    background-color: var(--primary-color);
    color: var(--surface-color);
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.submit-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.comments-section {
    margin-top: 50px;
    padding-top: 20px;
    text-align: left; /* Disqus looks better left-aligned */
}

.comments-section h3 {
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 480px) {
    .container {
        padding: 30px 15px;
    }

    h1 {
        font-size: 1.8rem;
    }

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

    .number-row {
        gap: 6px;
    }

    #generate-btn {
        width: 100%;
        margin-top: 30px;
    }
}
