/**
 * Zetpy Floating Spin Wheel Styles
 * Responsive floating image with multiple positioning options
 */

/* Base floating wheel styles */
.zetpy-floating-wheel {
    position: fixed;
    z-index: 1;
    display: block;
    transition: all 0.3s ease-in-out;
    opacity: 0;
    animation: zetpy-fade-in 0.5s ease-in-out 0.5s forwards;
}

/* Fade in animation */
@keyframes zetpy-fade-in {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Wheel container */
.zetpy-wheel-container {
    position: relative !important;
    display: inline-block;
    border-radius: 50%;
    overflow: visible !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    background: #fff;
}

.zetpy-wheel-container:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

/* Wheel image */
.zetpy-wheel-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

/* Spin animation on hover */
.zetpy-wheel-container:hover .zetpy-wheel-image {
    animation: zetpy-spin 2s linear infinite;
}

@keyframes zetpy-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Close button */
.zetpy-close-btn {
    position: absolute !important;
    top: -8px !important;
    right: -8px !important;
    width: 28px !important;
    height: 28px !important;
    border: none !important;
    border-radius: 50% !important;
    background: #ff4444 !important;
    color: white !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 20px !important;
    font-weight: bold !important;
    line-height: 1 !important;
    transition: all 0.3s ease !important;
    z-index: 10000 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.zetpy-close-btn:hover {
    background: #cc0000 !important;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}

.zetpy-close-btn span {
    margin-top: -1px;
    display: block;
    font-family: Arial, sans-serif;
}

/* Wheel text */
.zetpy-wheel-text {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.zetpy-wheel-container:hover .zetpy-wheel-text {
    opacity: 1;
}

/* Link styling */
.zetpy-wheel-link {
    text-decoration: none;
    display: block;
    border-radius: 50%;
}

/* POSITIONING STYLES */

/* Bottom Right (Default) */
.zetpy-position-bottom_right {
    bottom: 20px;
    right: 20px;
}

/* Bottom Left */
.zetpy-position-bottom_left {
    bottom: 20px;
    left: 20px;
}

/* Bottom Center */
.zetpy-position-bottom_center {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

/* CUSTOM POSITIONING ADJUSTMENTS */

/* Mobile view - move bottom positions up 85px */
.zetpy-view-mobile.zetpy-position-bottom_right,
.zetpy-view-mobile.zetpy-position-bottom_left {
    bottom: 85px !important;
}

/* Mobile view - move bottom center up 85px while preserving centering */
.zetpy-view-mobile.zetpy-position-bottom_center {
    bottom: 85px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

/* Desktop view - move bottom positions up 10px */
.zetpy-view-desktop.zetpy-position-bottom_right,
.zetpy-view-desktop.zetpy-position-bottom_left {
    bottom: 10px !important;
}

/* Desktop view - move bottom center up 10px while preserving centering */
.zetpy-view-desktop.zetpy-position-bottom_center {
    bottom: 10px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}

/* Desktop view - move right positions left 30px */
.zetpy-view-desktop.zetpy-position-bottom_right,
.zetpy-view-desktop.zetpy-position-top_right {
    right: 30px !important;
}

/* Mobile view - move right positions left 25px (15px + 10px more) */
.zetpy-view-mobile.zetpy-position-bottom_right,
.zetpy-view-mobile.zetpy-position-top_right {
    right: 25px !important;
}

/* Top Right */
.zetpy-position-top_right {
    top: 20px;
    right: 20px;
}

/* Top Left */
.zetpy-position-top_left {
    top: 20px;
    left: 20px;
}

/* Top Center */
.zetpy-position-top_center {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

/* VIEW TYPE STYLES */

/* Mobile View (Default) - Smaller Size */
.zetpy-view-mobile .zetpy-wheel-container {
    width: 90px;
    height: 90px;
}

.zetpy-view-mobile .zetpy-wheel-image {
    width: 90px;
    height: 90px;
}

/* Desktop View - Larger Size */
.zetpy-view-desktop .zetpy-wheel-container {
    width: 120px;
    height: 120px;
}

.zetpy-view-desktop .zetpy-wheel-image {
    width: 120px;
    height: 120px;
}

/* Desktop close button */
.zetpy-view-desktop .zetpy-close-btn {
    position: absolute !important;
    width: 32px !important;
    height: 32px !important;
    font-size: 22px !important;
    top: -16px !important;
    right: -10px !important;
    background: #ff4444 !important;
    color: white !important;
    display: flex !important;
    z-index: 10000 !important;
    opacity: 1 !important;
    visibility: visible !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
    pointer-events: auto !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Mobile close button */
.zetpy-view-mobile .zetpy-close-btn {
    position: absolute !important;
    width: 22px !important;
    height: 22px !important;
    font-size: 14px !important;
    top: -14px !important;
    right: -11px !important;
    background: #ff4444 !important;
    color: white !important;
    display: flex !important;
    z-index: 10000 !important;
    opacity: 1 !important;
    visibility: visible !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    pointer-events: auto !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    align-items: center !important;
    justify-content: center !important;
}

.zetpy-view-desktop .zetpy-wheel-text {
    font-size: 14px;
    padding: 6px 16px;
    bottom: -35px;
}

/* RESPONSIVE DESIGN */

/* Mobile devices */
@media (max-width: 768px) {
    .zetpy-floating-wheel {
        /* Adjust positioning for mobile */
    }
    
    .zetpy-position-bottom_right {
        bottom: 15px;
        right: 15px;
    }
    
    .zetpy-position-bottom_left {
        bottom: 15px;
        left: 15px;
    }
    
    .zetpy-position-bottom_center {
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .zetpy-position-top_right {
        top: 15px;
        right: 15px;
    }
    
    .zetpy-position-top_left {
        top: 15px;
        left: 15px;
    }
    
    .zetpy-position-top_center {
        top: 15px;
    }
    
    /* Force mobile size on small screens */
    .zetpy-view-desktop .zetpy-wheel-container {
        width: 70px;
        height: 70px;
    }
    
    .zetpy-view-desktop .zetpy-wheel-image {
        width: 70px;
        height: 70px;
    }
    
    .zetpy-view-mobile .zetpy-wheel-container {
        width: 70px;
        height: 70px;
    }
    
    .zetpy-view-mobile .zetpy-wheel-image {
        width: 70px;
        height: 70px;
    }
    
    .zetpy-close-btn {
        position: absolute !important;
        width: 24px !important;
        height: 24px !important;
        font-size: 14px !important;
        top: -10px !important;
        right: -20px !important;
        background: #ff4444 !important;
        color: white !important;
        display: flex !important;
        z-index: 10000 !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        border: none !important;
        border-radius: 50% !important;
        cursor: pointer !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .zetpy-wheel-text {
        font-size: 10px;
        padding: 3px 8px;
        bottom: -25px;
    }
}

/* Very small mobile devices */
@media (max-width: 480px) {
    .zetpy-position-bottom_right,
    .zetpy-position-top_right {
        right: 10px;
    }
    
    .zetpy-position-bottom_left,
    .zetpy-position-top_left {
        left: 10px;
    }
    
    .zetpy-position-bottom_right,
    .zetpy-position-bottom_left {
        bottom: 10px;
    }
    
    .zetpy-position-bottom_center {
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .zetpy-position-top_right,
    .zetpy-position-top_left,
    .zetpy-position-top_center {
        top: 10px;
    }
}

/* Large desktop screens */
@media (min-width: 1200px) {
    .zetpy-view-desktop .zetpy-wheel-container {
        width: 140px;
        height: 140px;
    }
    
    .zetpy-view-desktop .zetpy-wheel-image {
        width: 140px;
        height: 140px;
    }
    
    .zetpy-view-desktop .zetpy-close-btn {
        width: 32px;
        height: 32px;
        font-size: 20px;
        top: -12px;
        right: -12px;
    }
}

/* Accessibility improvements */
.zetpy-close-btn:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.zetpy-wheel-link:focus {
    outline: 3px solid #007cba;
    outline-offset: 3px;
    border-radius: 50%;
}

/* Print styles - hide floating elements */
@media print {
    .zetpy-floating-wheel {
        display: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .zetpy-wheel-container {
        border: 2px solid #000;
    }
    
    .zetpy-close-btn {
        border: 1px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .zetpy-floating-wheel,
    .zetpy-wheel-container,
    .zetpy-wheel-image,
    .zetpy-close-btn,
    .zetpy-wheel-text {
        animation: none !important;
        transition: none !important;
    }
    
    .zetpy-wheel-container:hover {
        transform: none;
    }
}

/* Custom pulse animation for attention */
.zetpy-floating-wheel.zetpy-pulse {
    animation: zetpy-pulse 2s infinite;
}

@keyframes zetpy-pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Hide on very small heights (landscape mobile) */
@media (max-height: 500px) and (orientation: landscape) {
    .zetpy-position-top_left,
    .zetpy-position-top_right,
    .zetpy-position-top_center {
        top: 5px;
    }
    
    .zetpy-position-bottom_left,
    .zetpy-position-bottom_right {
        bottom: 5px;
    }
    
    .zetpy-position-bottom_center {
        bottom: 5px;
        left: 50%;
        transform: translateX(-50%);
    }
}
