/* Wheel of Names - Main Styles */

/* Container */
.wheel-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Header */
.wheel-header {
    text-align: center;
    margin-bottom: 30px;
}

.wheel-title {
    color: white;
    font-size: 2.5em;
    margin: 0 0 20px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    font-weight: 700;
}

.wheel-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.wheel-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.wheel-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.wheel-btn svg {
    flex-shrink: 0;
}

/* Display Area */
.wheel-display-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.wheel-wrapper {
    position: relative;
    margin: 0 auto;
}

canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.wheel-pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 30px solid #ff4757;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
    z-index: 10;
}

.wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.center-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.center-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Action Buttons */
.wheel-action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.spin-button {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: none;
    color: white;
    padding: 18px 40px;
    font-size: 20px;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(245, 87, 108, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.spin-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(245, 87, 108, 0.6);
}

.spin-button:active {
    transform: translateY(-1px);
}

.spin-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.spin-button svg {
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin-button:not(:disabled):hover svg {
    animation-duration: 0.5s;
}

/* Popup Overlay */
.wheel-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.wheel-popup-overlay.active {
    display: flex;
}

.wheel-popup {
    background: white;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: popupSlideIn 0.3s ease;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.popup-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
}

.popup-close {
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    padding: 0;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
    line-height: 1;
}

.popup-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.popup-content {
    padding: 30px;
}

/* Settings Groups */
.setting-group {
    margin-bottom: 25px;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-group > label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: #2d3748;
    font-size: 15px;
}

.setting-group select,
.setting-group input[type="text"],
.setting-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.setting-group select:focus,
.setting-group input[type="text"]:focus,
.setting-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.setting-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Range Sliders */
.setting-group input[type="range"] {
    width: 100%;
    margin: 10px 0;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    outline: none;
}

.setting-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
}

.setting-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 8px rgba(102, 126, 234, 0.1);
}

.setting-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.setting-group input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 8px rgba(102, 126, 234, 0.1);
}

.volume-value,
.spin-time-value,
.max-names-value {
    display: inline-block;
    margin-left: 10px;
    font-weight: 600;
    color: #667eea;
}

/* Custom Checkboxes - IMPORTANT: Override theme styles */
.wheel-container .checkbox-group,
.wheel-popup .checkbox-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.wheel-container .checkbox-label,
.wheel-popup .checkbox-label,
.wheel-container label.checkbox-label,
.wheel-popup label.checkbox-label {
    position: relative !important;
    display: block !important;
    cursor: pointer !important;
    user-select: none !important;
    padding-left: 35px !important;
    padding-right: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin: 0 0 12px 0 !important;
    font-weight: 400 !important;
    color: #2d3748 !important;
    font-size: 14px !important;
    line-height: 1.8 !important;
    min-height: 24px !important;
}

.wheel-container .checkbox-label:last-child,
.wheel-popup .checkbox-label:last-child {
    margin-bottom: 0 !important;
}

/* Checkbox text wrapper */
.wheel-container .checkbox-text,
.wheel-popup .checkbox-text {
    display: inline-block !important;
    position: relative !important;
    vertical-align: middle !important;
}

/* Hide default checkbox but keep it accessible - VERY SPECIFIC */
.wheel-container .checkbox-label input[type="checkbox"],
.wheel-popup .checkbox-label input[type="checkbox"],
.wheel-container label.checkbox-label input[type="checkbox"],
.wheel-popup label.checkbox-label input[type="checkbox"] {
    position: absolute !important;
    opacity: 0 !important;
    cursor: pointer !important;
    height: 0 !important;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    left: -9999px !important;
    clip: rect(0, 0, 0, 0) !important;
    border: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
}

/* Custom checkbox - VERY SPECIFIC */
.wheel-container .checkbox-label .checkmark,
.wheel-popup .checkbox-label .checkmark,
.wheel-container label.checkbox-label .checkmark,
.wheel-popup label.checkbox-label .checkmark,
.wheel-container .checkbox-label span.checkmark,
.wheel-popup .checkbox-label span.checkmark {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    height: 22px !important;
    width: 22px !important;
    min-width: 22px !important;
    max-width: 22px !important;
    min-height: 22px !important;
    max-height: 22px !important;
    background-color: #fff !important;
    border: 2px solid #cbd5e0 !important;
    border-radius: 4px !important;
    transition: all 0.3s ease !important;
    display: block !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* On hover - VERY SPECIFIC */
.wheel-container .checkbox-label:hover .checkmark,
.wheel-popup .checkbox-label:hover .checkmark,
.wheel-container label.checkbox-label:hover .checkmark,
.wheel-popup label.checkbox-label:hover .checkmark,
.wheel-container label.checkbox-label:hover span.checkmark,
.wheel-popup label.checkbox-label:hover span.checkmark {
    border-color: #667eea !important;
    background-color: #f7fafc !important;
}

/* When checked - VERY SPECIFIC */
.wheel-container .checkbox-label input[type="checkbox"]:checked ~ .checkmark,
.wheel-popup .checkbox-label input[type="checkbox"]:checked ~ .checkmark,
.wheel-container label.checkbox-label input[type="checkbox"]:checked ~ .checkmark,
.wheel-popup label.checkbox-label input[type="checkbox"]:checked ~ .checkmark,
.wheel-container label.checkbox-label input[type="checkbox"]:checked ~ span.checkmark,
.wheel-popup label.checkbox-label input[type="checkbox"]:checked ~ span.checkmark {
    background-color: #667eea !important;
    border-color: #667eea !important;
}

/* Checkmark icon - VERY SPECIFIC */
.wheel-container .checkbox-label .checkmark:after,
.wheel-popup .checkbox-label .checkmark:after,
.wheel-container label.checkbox-label .checkmark:after,
.wheel-popup label.checkbox-label .checkmark:after,
.wheel-container label.checkbox-label span.checkmark:after,
.wheel-popup label.checkbox-label span.checkmark:after {
    content: "" !important;
    position: absolute !important;
    display: none !important;
    left: 7px !important;
    top: 3px !important;
    width: 5px !important;
    height: 10px !important;
    border: solid white !important;
    border-width: 0 2px 2px 0 !important;
    transform: rotate(45deg) !important;
    box-sizing: border-box !important;
}

/* Show checkmark when checked - VERY SPECIFIC */
.wheel-container .checkbox-label input[type="checkbox"]:checked ~ .checkmark:after,
.wheel-popup .checkbox-label input[type="checkbox"]:checked ~ .checkmark:after,
.wheel-container label.checkbox-label input[type="checkbox"]:checked ~ .checkmark:after,
.wheel-popup label.checkbox-label input[type="checkbox"]:checked ~ .checkmark:after,
.wheel-container label.checkbox-label input[type="checkbox"]:checked ~ span.checkmark:after,
.wheel-popup label.checkbox-label input[type="checkbox"]:checked ~ span.checkmark:after {
    display: block !important;
}

/* Focus state for accessibility - VERY SPECIFIC */
.wheel-container .checkbox-label input[type="checkbox"]:focus ~ .checkmark,
.wheel-popup .checkbox-label input[type="checkbox"]:focus ~ .checkmark,
.wheel-container label.checkbox-label input[type="checkbox"]:focus ~ .checkmark,
.wheel-popup label.checkbox-label input[type="checkbox"]:focus ~ .checkmark,
.wheel-container label.checkbox-label input[type="checkbox"]:focus ~ span.checkmark,
.wheel-popup label.checkbox-label input[type="checkbox"]:focus ~ span.checkmark {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2) !important;
    outline: none !important;
} .checkbox-label .checkmark,
.wheel-popup .checkbox-label .checkmark,
.wheel-container label.checkbox-label .checkmark,
.wheel-popup label.checkbox-label .checkmark,
.wheel-container .checkbox-label span.checkmark,
.wheel-popup .checkbox-label span.checkmark {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    height: 22px !important;
    width: 22px !important;
    min-width: 22px !important;
    max-width: 22px !important;
    min-height: 22px !important;
    max-height: 22px !important;
    background-color: #fff !important;
    border: 2px solid #cbd5e0 !important;
    border-radius: 4px !important;
    transition: all 0.3s ease !important;
    display: block !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* On hover - VERY SPECIFIC */
.wheel-container .checkbox-label:hover .checkmark,
.wheel-popup .checkbox-label:hover .checkmark,
.wheel-container label.checkbox-label:hover .checkmark,
.wheel-popup label.checkbox-label:hover .checkmark,
.wheel-container label.checkbox-label:hover span.checkmark,
.wheel-popup label.checkbox-label:hover span.checkmark {
    border-color: #667eea !important;
    background-color: #f7fafc !important;
}

/* When checked - VERY SPECIFIC */
.wheel-container .checkbox-label input[type="checkbox"]:checked ~ .checkmark,
.wheel-popup .checkbox-label input[type="checkbox"]:checked ~ .checkmark,
.wheel-container label.checkbox-label input[type="checkbox"]:checked ~ .checkmark,
.wheel-popup label.checkbox-label input[type="checkbox"]:checked ~ .checkmark,
.wheel-container label.checkbox-label input[type="checkbox"]:checked ~ span.checkmark,
.wheel-popup label.checkbox-label input[type="checkbox"]:checked ~ span.checkmark {
    background-color: #667eea !important;
    border-color: #667eea !important;
}

/* Checkmark icon - VERY SPECIFIC */
.wheel-container .checkbox-label .checkmark:after,
.wheel-popup .checkbox-label .checkmark:after,
.wheel-container label.checkbox-label .checkmark:after,
.wheel-popup label.checkbox-label .checkmark:after,
.wheel-container label.checkbox-label span.checkmark:after,
.wheel-popup label.checkbox-label span.checkmark:after {
    content: "" !important;
    position: absolute !important;
    display: none !important;
    left: 7px !important;
    top: 3px !important;
    width: 5px !important;
    height: 10px !important;
    border: solid white !important;
    border-width: 0 2px 2px 0 !important;
    transform: rotate(45deg) !important;
    box-sizing: border-box !important;
}

/* Show checkmark when checked - VERY SPECIFIC */
.wheel-container .checkbox-label input[type="checkbox"]:checked ~ .checkmark:after,
.wheel-popup .checkbox-label input[type="checkbox"]:checked ~ .checkmark:after,
.wheel-container label.checkbox-label input[type="checkbox"]:checked ~ .checkmark:after,
.wheel-popup label.checkbox-label input[type="checkbox"]:checked ~ .checkmark:after,
.wheel-container label.checkbox-label input[type="checkbox"]:checked ~ span.checkmark:after,
.wheel-popup label.checkbox-label input[type="checkbox"]:checked ~ span.checkmark:after {
    display: block !important;
}

/* Focus state for accessibility - VERY SPECIFIC */
.wheel-container .checkbox-label input[type="checkbox"]:focus ~ .checkmark,
.wheel-popup .checkbox-label input[type="checkbox"]:focus ~ .checkmark,
.wheel-container label.checkbox-label input[type="checkbox"]:focus ~ .checkmark,
.wheel-popup label.checkbox-label input[type="checkbox"]:focus ~ .checkmark,
.wheel-container label.checkbox-label input[type="checkbox"]:focus ~ span.checkmark,
.wheel-popup label.checkbox-label input[type="checkbox"]:focus ~ span.checkmark {
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2) !important;
    outline: none !important;
}

.setting-description {
    font-size: 13px;
    color: #718096;
    margin-top: 8px;
    font-style: italic;
}

.popup-message-input {
    margin-top: 10px;
}

/* Color Picker Grid */
.color-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.color-picker-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.segment-color-picker,
.background-color-picker {
    width: 70px;
    height: 70px;
    border: 3px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.segment-color-picker:hover,
.background-color-picker:hover {
    border-color: #667eea;
    transform: scale(1.05);
}

.remove-color-btn {
    background: #ef4444;
    color: white;
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    line-height: 1;
}

.remove-color-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.add-color-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 14px;
    margin-top: 10px;
}

.add-color-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

/* Image Upload */
.image-upload-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.upload-button {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.upload-button:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

.remove-image-btn {
    background: #ef4444;
}

.remove-image-btn:hover {
    background: #dc2626;
}

.image-preview {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

/* Winner Popup */
.winner-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    text-align: center;
    min-width: 400px;
    max-width: 90%;
    animation: winnerPopupSlideIn 0.5s ease;
}

.winner-popup.active {
    display: block;
}

@keyframes winnerPopupSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.winner-content {
    position: relative;
}

.winner-popup-close {
    position: absolute;
    top: -20px;
    right: -20px;
    background: #ef4444;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.winner-popup-close:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.winner-content h3 {
    font-size: 28px;
    color: #2d3748;
    margin: 0 0 20px 0;
}

.winner-name {
    font-size: 42px;
    font-weight: 700;
    color: #667eea;
    margin: 30px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f093fb20 0%, #f5576c20 100%);
    border-radius: 15px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.winner-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.winner-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-size: 15px;
}

.remove-winner-btn {
    background: #ef4444;
    color: white;
}

.remove-winner-btn:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.spin-again-btn {
    background: #667eea;
    color: white;
}

.spin-again-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .wheel-container {
        padding: 20px;
        margin: 20px;
    }
    
    .wheel-title {
        font-size: 2em;
    }
    
    .wheel-controls {
        flex-direction: column;
    }
    
    .wheel-btn {
        width: 100%;
        justify-content: center;
    }
    
    .spin-button {
        width: 100%;
        justify-content: center;
    }
    
    .popup-content {
        padding: 20px;
    }
    
    .color-picker-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
    
    .winner-popup {
        min-width: 300px;
        padding: 30px 20px;
    }
    
    .winner-name {
        font-size: 32px;
    }
    
    .winner-buttons {
        flex-direction: column;
    }
    
    .winner-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .wheel-title {
        font-size: 1.5em;
    }
    
    .wheel-btn {
        font-size: 12px;
        padding: 8px 15px;
    }
    
    .spin-button {
        font-size: 16px;
        padding: 14px 30px;
    }
}