:root {
    --primary-color: #6c5ce7;
    --secondary-color: #a29bfe;
    --accent-color: #fd79a8;
    --background-color: #f9f9f9;
    --card-color: #ffffff;
    --text-color: #333333;
    --text-light: #777777;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    text-align: center;
    margin-bottom: 30px;
}

.app-header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.app-header p {
    color: var(--text-light);
    font-size: 1rem;
}

.main-content {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 30px;
}

.wheel-container {
    flex: 1;
    min-width: 300px;
    max-width: 550px;
    position: relative;
}

.wheel-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 100%;
}

#wheelCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: var(--shadow);
    transition: transform 8s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background-color: var(--card-color);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.spin-button {
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(108, 92, 231, 0.4);
}

.spin-button:hover {
    background-color: #5649c5;
    transform: scale(1.05);
}

.pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 40px;
    background-color: var(--accent-color);
    clip-path: polygon(50% 100%, 0 0, 100% 0);
    z-index: 5;
}

.controls-container {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-section {
    background-color: var(--card-color);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.input-group input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.2);
}

.input-group button {
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-group button:hover {
    background-color: #5649c5;
}

.input-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.input-options button {
    padding: 8px 15px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
}

.input-options button:hover {
    background-color: #8c7eff;
}

.names-list-container {
    background-color: var(--card-color);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.names-list {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 10px;
    border: 1px solid #eee;
    border-radius: var(--border-radius);
    padding: 10px;
}

.name-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 8px;
    transition: var(--transition);
}

.name-item:last-child {
    margin-bottom: 0;
}

.name-item:hover {
    background-color: #e9ecef;
}

.name-item span {
    flex: 1;
    word-break: break-word;
}

.name-item button {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    padding: 5px;
    border-radius: 4px;
}

.name-item button:hover {
    color: var(--accent-color);
    background-color: rgba(253, 121, 168, 0.1);
}

.settings-section {
    background-color: var(--card-color);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 15px;
}

.setting {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.setting label {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 500;
}

.setting input[type="range"] {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    background: #ddd;
    border-radius: 4px;
    outline: none;
}

.setting input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

.setting select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    width: 100%;
    background-color: white;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: var(--transition);
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: var(--transition);
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.results-sidebar {
    position: fixed;
    top: 0;
    right: -350px;
    width: 350px;
    height: 100vh;
    background-color: var(--card-color);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    z-index: 100;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.results-sidebar.open {
    right: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.sidebar-header h3 {
    font-size: 1.2rem;
    color: var(--primary-color);
}

.sidebar-header button {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-header button:hover {
    color: var(--accent-color);
}

.results-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
}

.result-item {
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-item .result-name {
    font-weight: 500;
}

.result-item .result-time {
    font-size: 0.8rem;
    color: var(--text-light);
}

.sidebar-footer {
    display: flex;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.sidebar-footer button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sidebar-footer button:first-child {
    background-color: var(--primary-color);
    color: white;
}

.sidebar-footer button:first-child:hover {
    background-color: #5649c5;
}

.sidebar-footer button:last-child {
    background-color: #f1f1f1;
    color: var(--text-color);
}

.sidebar-footer button:last-child:hover {
    background-color: #e1e1e1;
}

.result-modal {
    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: 200;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.result-modal.open {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--card-color);
    padding: 30px;
    border-radius: var(--border-radius);
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow);
    transform: scale(0.9);
    transition: var(--transition);
}

.result-modal.open .modal-content {
    transform: scale(1);
}

.modal-content h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.winner-name {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
    margin: 20px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: var(--border-radius);
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-actions button {
    padding: 12px 25px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.modal-actions button:first-child {
    background-color: var(--primary-color);
    color: white;
}

.modal-actions button:first-child:hover {
    background-color: #5649c5;
}

.modal-actions button:last-child {
    background-color: #f1f1f1;
    color: var(--text-color);
}

.modal-actions button:last-child:hover {
    background-color: #e1e1e1;
}

.results-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: var(--transition);
    z-index: 50;
}

.results-toggle:hover {
    background-color: #5649c5;
    transform: scale(1.1);
}

.results-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--accent-color);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.app-footer {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-top: auto;
}

/* Responsive styles */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
        align-items: center;
    }
    
    .wheel-container, .controls-container {
        max-width: 100%;
    }
    
    .results-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .results-sidebar.open {
        right: 0;
    }
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 1.5s infinite;
}

@keyframes confetti {
    0% { transform: translateY(0) rotate(0); opacity: 1; }
    100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background-color: var(--accent-color);
    animation: confetti 3s ease-out forwards;
    z-index: 300;
}