:root {
    --bg-color: #f7f7f7;
    --container-bg: white;
    --text-color: #333;
    --h1-color: #4CAF50;
    --h2-color: #555;
    --border-color: #eee;
    --item-bg: #f9f9f9;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --dot-color: #ddd;
    --input-bg: #fff;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --container-bg: #2d2d2d;
    --text-color: #f0f0f0;
    --h1-color: #81c784;
    --h2-color: #ccc;
    --border-color: #444;
    --item-bg: #3d3d3d;
    --shadow-color: rgba(0, 0, 0, 0.4);
    --dot-color: #444;
    --input-bg: #333;
}

body {
    font-family: 'Helvetica Neue', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-image: radial-gradient(var(--dot-color) 1px, transparent 1px);
    background-size: 20px 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    background-color: var(--container-bg);
    padding: 2rem 3rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px var(--shadow-color);
    text-align: center;
    max-width: 600px;
    width: 90%;
    position: relative;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    margin: 2rem 0;
}

.header-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

#theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

#theme-toggle:hover {
    background-color: var(--border-color);
}

h1 {
    color: var(--h1-color);
    margin-bottom: 2rem;
    transition: color 0.3s ease;
}

.lotto-display {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
    perspective: 1000px;
}

#generate-btn {
    background-color: #4CAF50;
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background-color 0.3s ease, transform 0.1s ease;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

#generate-btn:hover {
    background-color: #45a049;
}

#generate-btn:active {
    transform: scale(0.98);
}

.history {
    margin-top: 3rem;
    text-align: left;
}

.history h2 {
    color: var(--h2-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    transition: color 0.3s ease, border-bottom 0.3s ease;
}

.history ul {
    list-style: none;
    padding: 0;
    max-height: 200px;
    overflow-y: auto;
}

.history li {
    background-color: var(--item-bg);
    padding: 0.8rem;
    border-radius: 5px;
    margin-bottom: 0.5rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    transition: background-color 0.3s ease;
}

.history li::before {
    content: '→';
    margin-right: 0.8rem;
    color: #4CAF50;
    font-weight: bold;
}

/* Contact Form Styling */
.contact-form {
    margin-top: 3rem;
    text-align: left;
    padding-top: 1rem;
}

.contact-form h2 {
    color: var(--h2-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    transition: color 0.3s ease, border-bottom 0.3s ease;
}

.form-group {
    margin-bottom: 1rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.8rem;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    background-color: var(--input-bg);
    color: var(--text-color);
    box-sizing: border-box;
    font-family: inherit;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

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

#submit-btn {
    background-color: #4CAF50;
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
    width: 100%;
}

#submit-btn:hover {
    background-color: #45a049;
}

@keyframes appear {
    0% {
        transform: scale(0) rotateY(360deg);
        opacity: 0;
    }
    100% {
        transform: scale(1) rotateY(0deg);
        opacity: 1;
    }
}

lotto-ball {
    animation: appear 0.5s ease-out forwards;
}
