/* Zetpy Spin Wheel Frontend Styles */

.zetpy-spin-wheel-button {
    background: linear-gradient(45deg, #ff6b6b, #ffd93d);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.zetpy-spin-wheel-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.zetpy-spin-wheel-button:active {
    transform: translateY(0);
}

/* Button Size Variants */
.zetpy-spin-wheel-button.button-size-small {
    padding: 8px 16px;
    font-size: 14px;
    min-height: 34px;
    border-radius: 25px;
}

.zetpy-spin-wheel-button.button-size-medium {
    padding: 10px 20px;
    font-size: 16px;
    min-height: 40px;
    border-radius: 30px;
}

.zetpy-spin-wheel-button.button-size-large {
    padding: 12px 24px;
    font-size: 18px;
    min-height: 46px;
    border-radius: 35px;
}

/* Modal Styles */
.zetpy-spin-wheel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto; /* Allow scrolling if content is too tall for viewport */
}

.zetpy-spin-wheel-overlay.show {
    opacity: 1;
}

.zetpy-spin-wheel-modal {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 600px;
    max-height: 95vh;
    overflow: visible; /* Remove auto scroll, let content size naturally */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.8) translateY(50px);
    transition: transform 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.zetpy-spin-wheel-overlay.show .zetpy-spin-wheel-modal {
    transform: scale(1) translateY(0);
}

.zetpy-spin-wheel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border-radius: 20px 20px 0 0;
}

.zetpy-spin-wheel-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
}

.zetpy-spin-wheel-close {
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.zetpy-spin-wheel-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Division Layout Styles */
.time-per-spin-division {
    background: #fef9e7;
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    border-bottom: 1px solid #ddd;
}

.time-per-spin-division .time-per-spin {
    font-size: 14px;
    color: #333;
    margin: 0 0 8px 0;
    font-weight: 600;
}

.time-per-spin-division .remaining-spins {
    font-size: 13px;
    color: #666;
    margin: 0;
    font-weight: normal;
}

.wheel-division {
    background: #e8f4f8;
    padding: 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 450px;
    flex: 1;
}

.zetpy-spin-wheel-content {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 0; /* Allow content to shrink */
    width: 100%;
    height: 100%;
}

/* Wheel Container - Enhanced Responsive */
.zetpy-spin-wheel-wrapper {
    position: relative;
    margin: 0 auto;
    display: inline-block;
    max-width: 100%;
    width: auto;
    height: auto;
    overflow: visible; /* Ensure pointer and button are visible */
    flex-shrink: 0; /* Prevent shrinking in flex container */
}



.zetpy-spin-wheel-canvas {
    border: 8px solid #333;
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 100%;
    height: auto;
    display: block;
}

/* Responsive Wheel Sizes */
.responsive-wheel {
    width: 100% !important;
    height: auto !important;
}

.responsive-wheel .zetpy-spin-wheel-canvas {
    width: 100% !important;
    height: auto !important;
}



/* Wheel Size Variants */
.wheel-small .zetpy-spin-wheel-canvas {
    max-width: 300px;
    max-height: 300px;
}

.wheel-small .zetpy-spin-wheel-spin-button {
    width: 60px;
    height: 60px;
    font-size: 14px;
}

.wheel-small .zetpy-spin-wheel-pointer {
    top: -12px;
    border-left-width: 12px;
    border-right-width: 12px;
    border-top-width: 24px;
}

.wheel-large .zetpy-spin-wheel-canvas {
    max-width: 400px;
    max-height: 400px;
}

.wheel-large .zetpy-spin-wheel-spin-button {
    width: 80px;
    height: 80px;
    font-size: 16px;
}



.zetpy-spin-wheel-pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 30px solid #333;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.zetpy-spin-wheel-spin-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(45deg, #ff6b6b, #ffd93d);
    color: white;
    border: none;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 1px;
    touch-action: manipulation;
}

.zetpy-spin-wheel-spin-button:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.zetpy-spin-wheel-spin-button:active {
    transform: translate(-50%, -50%) scale(0.95);
}

.zetpy-spin-wheel-spin-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: translate(-50%, -50%) scale(1);
}

/* Spinning Message */
.zetpy-spin-wheel-spinning-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    z-index: 15;
    min-width: 120px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    opacity: 0.8;
}

.spinning-text {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.spinning-loader {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin-loader 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin-loader {
    to {
        transform: rotate(360deg);
    }
}

/* Spinning Animation */
.zetpy-spin-wheel-canvas.spinning {
    animation: spin 3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(1800deg); /* 5 full rotations */
    }
}

/* Result Display */
.zetpy-spin-wheel-result {
    margin-top: 30px;
    padding: 30px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border-radius: 15px;
    text-align: center;
}

.zetpy-spin-wheel-result h4 {
    margin: 0 0 15px 0;
    font-size: 28px;
    font-weight: bold;
}

.zetpy-spin-wheel-result .result-message {
    margin: 0 0 20px 0;
    font-size: 18px;
    line-height: 1.5;
}

.zetpy-spin-wheel-collect {
    background: white;
    color: #667eea;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    touch-action: manipulation;
    min-height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.zetpy-spin-wheel-collect:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Enhanced Responsive Design */

/* Large Desktop */
@media (min-width: 1200px) {
    .zetpy-spin-wheel-modal {
        max-width: 700px;
        max-height: 90vh;
    }
    
    .zetpy-spin-wheel-canvas {
        max-width: 350px;
        max-height: 350px;
    }
    
    .zetpy-spin-wheel-spin-button {
        width: 80px;
        height: 80px;
        font-size: 16px;
    }
}

/* Desktop */
@media (min-width: 992px) and (max-width: 1199px) {
    .zetpy-spin-wheel-canvas {
        max-width: 300px;
        max-height: 300px;
    }
    
    .zetpy-spin-wheel-spin-button {
        width: 75px;
        height: 75px;
        font-size: 15px;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 991px) {
    .zetpy-spin-wheel-modal {
        max-width: 550px;
        max-height: 85vh;
    }
    
    .zetpy-spin-wheel-header {
        padding: 20px 25px;
    }
    
    .zetpy-spin-wheel-header h3 {
        font-size: 22px;
    }
    
    .time-per-spin-division {
        padding: 15px;
        min-height: 70px;
    }
    
    .wheel-division {
        padding: 25px;
        min-height: 400px;
    }
    
    .zetpy-spin-wheel-canvas {
        max-width: 280px;
        max-height: 280px;
    }
    
    .zetpy-spin-wheel-spin-button {
        width: 70px;
        height: 70px;
        font-size: 14px;
    }
    
    .zetpy-spin-wheel-result {
        padding: 25px;
    }
    
    .zetpy-spin-wheel-result h4 {
        font-size: 26px;
    }
    
    .zetpy-spin-wheel-result .result-message {
        font-size: 17px;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .zetpy-spin-wheel-overlay {
        padding: 10px;
    }
    
    .zetpy-spin-wheel-modal {
        margin: 0;
        border-radius: 15px;
        max-height: 90vh;
        width: 95%;
        max-width: 95%;
    }
    
    .zetpy-spin-wheel-header {
        padding: 15px 20px;
        border-radius: 15px 15px 0 0;
    }
    
    .zetpy-spin-wheel-header h3 {
        font-size: 20px;
    }
    
    .zetpy-spin-wheel-close {
        width: 35px;
        height: 35px;
        font-size: 25px;
    }
    
    .time-per-spin-division {
        padding: 12px;
        min-height: 60px;
    }
    
    .time-per-spin-division .time-per-spin {
        font-size: 12px;
    }
    
    .time-per-spin-division .remaining-spins {
        font-size: 11px;
    }
    
    .wheel-division {
        padding: 15px 10px;
        min-height: 350px;
    }
    
    .zetpy-spin-wheel-canvas {
        max-width: 240px;
        max-height: 240px;
        border-width: 6px;
    }
    
    .zetpy-spin-wheel-pointer {
        top: -12px;
        left: 50%;
        transform: translateX(-50%);
        border-left-width: 12px;
        border-right-width: 12px;
        border-top-width: 24px;
    }
    
    .zetpy-spin-wheel-spin-button {
        width: 50px;
        height: 50px;
        font-size: 12px;
        letter-spacing: 0.5px;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .zetpy-spin-wheel-spinning-message {
        padding: 15px;
        min-width: 100px;
    }
    
    .spinning-text {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .spinning-loader {
        width: 25px;
        height: 25px;
        border-width: 2px;
    }
    
    .zetpy-spin-wheel-result {
        padding: 20px 15px;
        margin-top: 20px;
        border-radius: 12px;
    }
    
    .zetpy-spin-wheel-result h4 {
        font-size: 22px;
        margin-bottom: 12px;
    }
    
    .zetpy-spin-wheel-result .result-message {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .zetpy-spin-wheel-collect {
        padding: 12px 25px;
        font-size: 15px;
        border-radius: 20px;
        min-height: 45px;
    }
    
    .zetpy-spin-wheel-button {
        padding: 12px 25px;
        font-size: 16px;
        min-height: 45px;
    }
    
    /* Responsive Button Size Adjustments for Mobile */
    .zetpy-spin-wheel-button.button-size-small {
        padding: 6px 12px;
        font-size: 13px;
        min-height: 30px;
    }
    
    .zetpy-spin-wheel-button.button-size-medium {
        padding: 8px 16px;
        font-size: 15px;
        min-height: 36px;
    }
    
    .zetpy-spin-wheel-button.button-size-large {
        padding: 10px 20px;
        font-size: 16px;
        min-height: 42px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .zetpy-spin-wheel-overlay {
        padding: 5px;
    }
    
    .zetpy-spin-wheel-modal {
        width: 98%;
        max-width: 98%;
        max-height: 95vh;
    }
    
    .time-per-spin-division {
        padding: 10px;
        min-height: 50px;
    }
    
    .time-per-spin-division .time-per-spin {
        font-size: 11px;
    }
    
    .time-per-spin-division .remaining-spins {
        font-size: 10px;
    }
    
    .wheel-division {
        padding: 10px 8px;
        min-height: 300px;
    }
    
    .zetpy-spin-wheel-canvas {
        max-width: 220px;
        max-height: 220px;
        border-width: 4px;
    }
    
    .zetpy-spin-wheel-pointer {
        top: -10px;
        left: 50%;
        transform: translateX(-50%);
        border-left-width: 10px;
        border-right-width: 10px;
        border-top-width: 20px;
    }
    
    .zetpy-spin-wheel-spin-button {
        width: 45px;
        height: 45px;
        font-size: 11px;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .zetpy-spin-wheel-spinning-message {
        padding: 12px;
        min-width: 90px;
    }
    
    .spinning-text {
        font-size: 12px;
        margin-bottom: 6px;
    }
    
    .spinning-loader {
        width: 20px;
        height: 20px;
        border-width: 2px;
    }
    
    .zetpy-spin-wheel-result h4 {
        font-size: 20px;
    }
    
    .zetpy-spin-wheel-result .result-message {
        font-size: 15px;
    }
    
    .zetpy-spin-wheel-collect {
        padding: 10px 20px;
        font-size: 14px;
        min-height: 40px;
    }
    
    .zetpy-spin-wheel-button {
        padding: 10px 20px;
        font-size: 15px;
        min-height: 40px;
    }
    
    /* Responsive Button Size Adjustments for Small Mobile */
    .zetpy-spin-wheel-button.button-size-small {
        padding: 5px 10px;
        font-size: 12px;
        min-height: 28px;
    }
    
    .zetpy-spin-wheel-button.button-size-medium {
        padding: 6px 12px;
        font-size: 14px;
        min-height: 32px;
    }
    
    .zetpy-spin-wheel-button.button-size-large {
        padding: 8px 16px;
        font-size: 15px;
        min-height: 36px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .zetpy-spin-wheel-button:hover {
        transform: none;
        box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    }
    
    .zetpy-spin-wheel-spin-button:hover {
        transform: translate(-50%, -50%) scale(1);
    }
    
    .zetpy-spin-wheel-collect:hover {
        transform: none;
        background: white;
        box-shadow: none;
    }
    
    .zetpy-spin-wheel-close:hover {
        background: none;
    }
    
    /* Add touch feedback */
    .zetpy-spin-wheel-button:active {
        transform: scale(0.95);
    }
    
    .zetpy-spin-wheel-spin-button:active {
        transform: translate(-50%, -50%) scale(0.95);
    }
    
    .zetpy-spin-wheel-collect:active {
        transform: scale(0.95);
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .zetpy-spin-wheel-canvas {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Success/Error Messages */
.zetpy-spin-wheel-message {
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-weight: 500;
}

.zetpy-spin-wheel-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.zetpy-spin-wheel-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Loading Animation */
.zetpy-spin-wheel-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin-loading 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin-loading {
    to {
        transform: rotate(360deg);
    }
}

/* Landscape Mobile Optimization */
@media (max-width: 767px) and (orientation: landscape) {
    .zetpy-spin-wheel-modal {
        max-height: 95vh;
        width: 90%;
        max-width: 500px;
    }
    
    .time-per-spin-division {
        padding: 8px;
        min-height: 40px;
    }
    
    .wheel-division {
        padding: 10px;
        min-height: 250px;
    }
    
    .zetpy-spin-wheel-canvas {
        max-width: 200px;
        max-height: 200px;
    }
    
    .zetpy-spin-wheel-result {
        margin-top: 15px;
        padding: 15px;
    }
    
    .zetpy-spin-wheel-result h4 {
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    .zetpy-spin-wheel-result .result-message {
        font-size: 14px;
        margin-bottom: 10px;
    }
}

/* Error Modal Styles */
.error-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

.error-modal-overlay.show {
    opacity: 1;
    display: flex !important;
}

.error-modal {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: scale(0.8) translateY(50px);
    transition: transform 0.3s ease;
    overflow: hidden;
    margin: auto;
    position: relative;
}

.error-modal-overlay.show .error-modal {
    transform: scale(1) translateY(0);
}

.error-modal-header {
    background: linear-gradient(45deg, #ff6b6b, #ff4757);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.error-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
}

.error-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.error-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.error-modal-body {
    padding: 20px;
}

.error-modal-body p {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
}

.error-modal-footer {
    padding: 0 20px 20px 20px;
    text-align: right;
}

.error-modal-button {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.error-modal-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Error Modal Mobile responsive */
@media (max-width: 480px) {
    .error-modal {
        max-width: 90%;
        margin: 20px;
    }
    
    .error-modal-header,
    .error-modal-body,
    .error-modal-footer {
        padding: 15px;
    }
    
    .error-modal-header h3 {
        font-size: 16px;
    }
    
    .error-modal-body p {
        font-size: 14px;
    }
}