:root {
    /* Light theme (default) */
    --primary-color: #232f3e;
    --secondary-color: #ff9900;
    --background-color: #f8f8f8;
    --arrow-color: #00D0A0;
    --card-background: #ffffff;
    --text-color: #232f3e;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --button-hover: #ff9900;
    --input-background: #ffffff;
}

[data-theme="dark"] {
    --primary-color: #ff9900;
    --secondary-color: #232f3e;
    --background-color: #121212;
    --card-background: #1e1e1e;
    --text-color: #f8f8f8;
    --border-color: #333333;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --button-hover: #ff9900;
    --input-background: #2d2d2d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    transition: all 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
}

#theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.3s;
}

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

.input-section {
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px var(--shadow-color);
    margin-bottom: 2rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--input-background);
    color: var(--text-color);
    font-size: 1rem;
    resize: vertical;
    margin-bottom: 1rem;
}

.options {
    margin-bottom: 1rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 1rem;
    user-select: none;
}

.checkbox-container input {
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 20px;
    width: 20px;
    background-color: var(--input-background);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
}

.checkbox-container:hover input ~ .checkmark {
    background-color: var(--border-color);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
}

button:active {
    transform: scale(0.98);
}

.primary-button {
    background-color: var(--secondary-color);
    color: white;
    margin-right: 1rem;
}

.primary-button:hover {
    background-color: var(--button-hover);
}

.secondary-button {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.secondary-button:hover {
    background-color: var(--border-color);
}

.wheel-container {
    position: relative;
    width: 400px;
    height: 400px;
    margin: 0 auto 2rem;
}

#wheel {
    display: block;
    margin: 0 auto;
}

#selector {
    position: absolute;
    top: 50%;
    left: 92%;
    width: 0;
    height: 0;
    border-left: 0px solid var(--arrow-color);
    border-right: 50px solid var(--arrow-color);
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    transform: translateX(-100%);
    transform: translateY(-50%);
    z-index: 10;
}

.result-section {
    background-color: var(--card-background);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px var(--shadow-color);
    text-align: center;
}

#result {
    font-size: 2rem;
    font-weight: bold;
    color: var(--secondary-color);
    margin: 1rem 0 2rem;
    min-height: 3rem;
}

.history-section {
    text-align: left;
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

#history-list {
    list-style-type: none;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
}

#history-list li {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

#history-list li:last-child {
    border-bottom: none;
}

footer {
    text-align: center;
    padding: 1rem;
    background-color: var(--card-background);
    color: var(--text-color);
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .wheel-container {
        width: 300px;
        height: 300px;
    }
    
    #wheel {
        width: 300px;
        height: 300px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    #result {
        font-size: 1.5rem;
    }
}
