/* Spin the Wheel Tool Styles */

.wheel-container {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 400px;
    height: 400px;
    margin: 0 auto;
}

#wheelCanvas {
    transition: transform ease-out;
    cursor: pointer;
}

#wheelCanvas.spinning {
    pointer-events: none;
}

#spinButton {
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    line-height: 1;
    transition: all 0.3s ease;
    user-select: none;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#spinButton:hover {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

#spinButton:active {
    transform: translate(-50%, -50%) scale(0.95);
}

#spinButton.spinning {
    pointer-events: none;
    opacity: 0.7;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }
}

#wheelPointer {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    z-index: 10;
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.option-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.option-item:hover {
    background: #ffffff;
    border-color: #dee2e6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.option-color {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.option-text {
    flex: 1;
    font-weight: 500;
    color: #495057;
}

.option-weight {
    background: #e9ecef;
    color: #6c757d;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.option-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.option-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-btn.edit-btn {
    background: #3b82f6;
    color: white;
}

.option-btn.edit-btn:hover {
    background: #2563eb;
}

.option-btn.delete-btn {
    background: #ef4444;
    color: white;
}

.option-btn.delete-btn:hover {
    background: #dc2626;
}

.template-btn.active {
    border-color: #3b82f6 !important;
    background: #dbeafe !important;
}

.toggle-bg {
    background-color: #d1d5db;
    position: relative;
    transition: background-color 0.3s ease;
}

.toggle-bg:checked {
    background-color: #3b82f6;
}

.toggle-bg::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    background: white;
    border-radius: 50%;
    height: 20px;
    width: 20px;
    transition: transform 0.3s ease;
}

.toggle-bg:checked::after {
    transform: translateX(20px);
}

#resultDisplay {
    animation: slideInUp 0.6s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.history-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.2s ease;
}

.history-item:hover {
    background: #ffffff;
    border-color: #dee2e6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.history-result {
    font-weight: 600;
    font-size: 18px;
    color: #1f2937;
    margin-bottom: 4px;
}

.history-time {
    font-size: 12px;
    color: #6b7280;
}

.spin-animation {
    animation: wheelSpin 0.1s linear;
}

@keyframes wheelSpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #wheelCanvas {
        width: 300px !important;
        height: 300px !important;
    }

    .wheel-container {
        transform: scale(0.85);
    }

    #spinButton {
        width: 60px;
        height: 60px;
        font-size: 10px;
    }

    .option-item {
        padding: 10px;
        gap: 10px;
    }

    .option-color {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    #wheelCanvas {
        width: 250px !important;
        height: 250px !important;
    }

    .wheel-container {
        transform: scale(0.8);
    }

    #spinButton {
        width: 50px;
        height: 50px;
        font-size: 9px;
    }
}

/* Custom scrollbar for options list */
#optionsList::-webkit-scrollbar {
    width: 6px;
}

#optionsList::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#optionsList::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

#optionsList::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Accessibility improvements */
.option-btn:focus,
#spinButton:focus,
button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .bg-gradient-to-br {
        background: white !important;
    }

    button,
    .option-btn {
        display: none !important;
    }

    #wheelCanvas {
        max-width: 100% !important;
        height: auto !important;
    }
}
