/* Base Styles */
:root {
    --primary-color: #4a6bff;
    --secondary-color: #ff6b6b;
    --background-color: #ffffff;
    --text-color: #333333;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --menu-bg-color: #ffffff;
    --popup-bg-color: #ffffff;
}

[data-theme="dark"] {
    --primary-color: #6c8fff;
    --secondary-color: #ff8585;
    --background-color: #222222;
    --text-color: #f0f0f0;
    --border-color: #444444;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --menu-bg-color: #333333;
    --popup-bg-color: #333333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    transition: background-color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    line-height: 1.2;
}

h1 {
    font-size: 2.5rem;
    text-align: center;
    margin-top: 1rem;
}

h2 {
    font-size: 2rem;
    color: var(--primary-color);
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
}

.subtitle {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--background-color);
    box-shadow: 0 2px 5px var(--shadow-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    display: flex;
    align-items: center;
}

.logo i {
    margin-right: 0.5rem;
}

.main-nav ul {
    display: flex;
    list-style: none;
}

.main-nav li {
    margin-left: 1.5rem;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
}

.main-nav a:hover {
    color: var(--primary-color);
}

/* Wheel Section Layout */
.wheel-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 500px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Preset Buttons */
.preset-buttons-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.preset-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    width: auto;
    min-width: min-content;
}

.preset-button {
    background-color: #4a6bff;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    white-space: nowrap;
    transition: background-color 0.3s ease;
}

.preset-button:hover {
    background-color: #3a5bef;
}

.preset-button i {
    margin-right: 8px;
}

/* Wheel Container */
.wheel-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
    margin: 0 auto 1rem;
}

#chart {
    width: 100%;
    height: 100%;
    margin: 0 auto;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

#chart svg {
    width: 100%;
    height: 100%;
    display: block;
    margin: 0 auto;
}

#question {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
}

#question h1 {
    font-size: 1.5rem;
    text-align: center;
    margin: 0;
}

/* Control Buttons */
.control-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 1rem;
    width: 100%;
}

.control-button {
    background: var(--button-bg-color);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-color);
    transition: background-color 0.3s ease;
    margin: 0 5px;
}

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

/* Menus */
.menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--menu-bg-color);
    border-radius: 10px;
    box-shadow: 0 5px 15px var(--shadow-color);
    width: 300px;
    max-width: 90%;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu.active {
    opacity: 1;
    visibility: visible;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.menu-header h3 {
    margin: 0;
}

.close-menu {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.menu-content {
    padding: 15px;
}

.menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.menu-item:last-child {
    margin-bottom: 0;
}

.menu-item span {
    flex: 1;
}

.menu-item input[type="range"] {
    width: 120px;
}

.menu-item input[type="color"] {
    width: 40px;
    height: 30px;
    border: none;
    cursor: pointer;
}

/* Winner Popup */
.winner-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.winner-popup.active {
    opacity: 1;
    visibility: visible;
}

.winner-content {
    background-color: #2a2a2a;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    max-width: 90%;
    width: 400px;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    color: #fff;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.winner-popup.active .winner-content {
    transform: scale(1);
}

.close-popup {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #ff4444;
    transition: color 0.3s;
}

.close-popup:hover {
    color: #ff6666;
}

.winner-name {
    font-size: 2rem;
    font-weight: bold;
    margin: 20px 0;
    word-break: break-word;
    color: #fff;
}

.winner-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.button-gap {
    margin: 0 5px;
}

.continue-button, .replay-button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.continue-button {
    background-color: #2ecc71;
    color: white;
}

.replay-button {
    background-color: #3498db;
    color: white;
}

.continue-button:hover, .replay-button:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.continue-button i, .replay-button i {
    margin-right: 8px;
}

/* Options Section */
.options-section {
    max-width: 400px;
    margin: 0 auto 2rem;
    padding: 0 20px;
    text-align: center;
}

.options-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #fff;
}

.input-group {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    margin-bottom: 1rem;
}

.input-group input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--input-bg-color);
    color: var(--text-color);
}

.input-group button {
    padding: 0.5rem 1rem;
    background: var(--button-bg-color);
    border: none;
    border-radius: 4px;
    color: var(--text-color);
    cursor: pointer;
    transition: background 0.3s;
}

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

#options-list {
    width: 100%;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0.75rem;
    background: var(--input-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
}

.option-text {
    flex: 1;
    text-align: left;
    margin-right: 1rem;
    word-break: break-word;
}

.option-item button {
    background: none;
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: color 0.3s;
    flex-shrink: 0;
}

.option-item button:hover {
    filter: brightness(1.2);
}

/* Add Options Title */
.add-options-title {
    color: #6c8fff;
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

/* Content Sections */
.content-section {
    margin-bottom: 4rem;
    padding: 2rem;
    background-color: var(--background-color);
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--shadow-color);
}

.content-section h2 {
    text-align: center;
    margin-bottom: 2rem;
}

/* How It Works Section */
.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.step {
    text-align: center;
    padding: 1.5rem;
    border-radius: 10px;
    background-color: var(--background-color);
    box-shadow: 0 2px 10px var(--shadow-color);
    transition: transform 0.3s ease;
}

.step:hover {
    transform: translateY(-5px);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 1rem;
}

/* Features Section */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature {
    padding: 1.5rem;
    border-radius: 10px;
    background-color: var(--background-color);
    box-shadow: 0 2px 10px var(--shadow-color);
    text-align: center;
    transition: transform 0.3s ease;
}

.feature:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* FAQ Section */
.faq-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.faq-item {
    padding: 1.5rem;
    border-radius: 10px;
    background-color: var(--background-color);
    box-shadow: 0 2px 10px var(--shadow-color);
}

.faq-item h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Use Cases Section */
.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.use-case {
    padding: 1.5rem;
    border-radius: 10px;
    background-color: var(--background-color);
    box-shadow: 0 2px 10px var(--shadow-color);
    transition: transform 0.3s ease;
}

.use-case:hover {
    transform: translateY(-5px);
}

.use-case h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

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

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.footer-nav a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.7rem;
    }
    
    h3 {
        font-size: 1.3rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    header {
        flex-direction: column;
        padding: 1rem;
    }
    
    .logo {
        margin-bottom: 1rem;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .main-nav li {
        margin: 0.5rem;
    }
    
    .preset-buttons {
        flex-wrap: wrap;
        width: 100%;
    }
    
    .preset-button {
        width: auto;
    }
    
    .content-section {
        padding: 1.5rem;
    }
    
    .steps-container, .features-grid, .use-cases-grid {
        grid-template-columns: 1fr;
    }
    
    .winner-name {
        font-size: 1.5rem;
    }
    
    .winner-buttons {
        flex-direction: column;
    }
    
    .button-gap {
        margin: 5px 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .preset-button {
        width: 100%;
        justify-content: center;
    }
    
    .winner-content {
        padding: 20px;
    }
    
    .footer-nav {
        flex-direction: column;
        gap: 0.8rem;
    }
}

/* Color Picker Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2500;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--menu-bg-color);
    border-radius: 10px;
    padding: 20px;
    width: 300px;
    max-width: 90%;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-body input[type="color"] {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.modal-body .apply-color {
    padding: 10px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.modal-body .apply-color:hover {
    background-color: #3a5bef;
}

/* Add these CSS variables at the top of your file */
:root[data-theme="light"] {
    --input-bg-color: #ffffff;
    --button-bg-color: #f0f0f0;
    --button-hover-color: #e0e0e0;
}

:root[data-theme="dark"] {
    --input-bg-color: #2a2a2a;
    --button-bg-color: #444;
    --button-hover-color: #555;
}
