/* Discount Wheel - Main Styles */

.discount-wheel-wrapper {
    padding: 20px;
    text-align: center;
}

.discount-wheel-toggle,
.dw-spin-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.discount-wheel-toggle:hover,
.dw-spin-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.discount-wheel-toggle:active,
.dw-spin-button:active {
    transform: translateY(0);
}

.discount-wheel-toggle:disabled,
.dw-spin-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal Styles */
#discount-wheel-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

#discount-wheel-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Animation Types */
#discount-wheel-modal.active.animation-smooth .dw-modal-content {
    animation: slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#discount-wheel-modal.active.animation-bounce .dw-modal-content {
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.25, 1.55);
}

#discount-wheel-modal.active.animation-elastic .dw-modal-content {
    animation: elasticIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

#discount-wheel-modal.active.animation-fast .dw-modal-content {
    animation: zoomIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(60px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes elasticIn {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    55% {
        opacity: 1;
        transform: scale(1.1);
    }
    75% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.dw-modal-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
    position: relative;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
}

.dw-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    transition: color 0.2s, transform 0.2s;
}

.dw-close:hover {
    color: #333;
    transform: scale(1.2);
}

.dw-modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.dw-modal-header h2 {
    margin: 0 0 10px;
    color: #333;
    font-size: 24px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dw-modal-header p {
    color: #666;
    margin: 0;
    font-size: 14px;
}

.dw-canvas-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

#discount-wheel-canvas {
    width: 100%;
    height: auto;
    max-width: 400px;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.15));
    transition: transform 0.1s linear;
}

.dw-pointer {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 18px solid #667eea;
    z-index: 10;
    filter: drop-shadow(0 4px 2px rgba(0, 0, 0, 0.2));
}

.dw-modal-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Result Message Styles */
.dw-result-message {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-top: 20px;
    animation: slideUpMessage 0.4s ease;
}

@keyframes slideUpMessage {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dw-result-message h3 {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: bold;
}

.dw-result-message p {
    margin: 0 0 15px;
    font-size: 16px;
}

.dw-result-message code {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 15px;
    border-radius: 5px;
    display: inline-block;
    font-size: 18px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    transition: all 0.2s;
}

.dw-result-message code:hover {
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
}

/* Wheel Animation */
#discount-wheel-canvas {
    transition: transform 0.1s linear;
}

.wheel-spinning {
    animation: wheelSpin 1s ease-out;
}

@keyframes wheelSpin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 480px) {
    .dw-modal-content {
        max-width: 90vw;
        padding: 20px;
        border-radius: 12px;
    }
    
    .dw-modal-header h2 {
        font-size: 20px;
    }
    
    .dw-modal-header p {
        font-size: 12px;
    }
    
    .discount-wheel-toggle,
    .dw-spin-button {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    #discount-wheel-canvas {
        max-width: 300px;
    }
    
    .dw-pointer {
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-top: 15px solid #667eea;
    }
}

/* Loading State */
.dw-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.dw-loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Smooth transitions */
* {
    box-sizing: border-box;
}

button, input, select, textarea {
    transition: all 0.2s ease;
}

/* Enhanced hover effects */
.dw-spin-button:not(:disabled):hover {
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
    transform: translateY(-3px) scale(1.02);
}

/* Canvas improvements - better rendering */
#discount-wheel-canvas {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}
