/**
 * LuckyWeel - Ruleta de la Suerte
 * Styles for the WordPress plugin
 */

/* Reset for plugin container - avoid conflicts with theme */
.luckyweel-container,
.luckyweel-container * {
    box-sizing: border-box;
}

.luckyweel-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Wheel wrapper */
.luckyweel-wheel-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 400px;
}

/* Spin button */
.luckyweel-container .spinBtn {
    position: relative;
    width: 100%;
    max-width: 400px;
    padding: 20px;
    font-weight: 700;
    font-size: 2rem;
    color: #ededed !important;
    background-color: #972E34 !important;
    border-radius: 6px;
    border: none !important;
    box-shadow: 0 2px 0 #6e151a;
    cursor: pointer;
    font-family: inherit;
    margin-bottom: 20px;
    z-index: 100;
}

.luckyweel-container .spinBtn:hover {
    background-color: #a71a21 !important;
}

.luckyweel-container .spinBtn:disabled {
    background-color: #999 !important;
    box-shadow: none;
    cursor: not-allowed;
}

/* Wheel container */
.luckyweel-container .wheelContainer {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    margin: 0;
    width: 100%;
    min-height: 300px;
}

/* SVG Wheel */
.luckyweel-container .wheelSVG {
    position: relative;
    overflow: visible;
    width: 100%;
    max-width: 700px;
    height: auto;
    visibility: visible;
}

/* Hide peg and wheel initially until initialized */
.luckyweel-container .peg,
.luckyweel-container .wheel {
    visibility: hidden;
}

.luckyweel-container .wheel.initialized .peg,
.luckyweel-container .wheel.initialized {
    visibility: visible;
}

/* Center circle, value container, wheel outline */
.luckyweel-container .centerCircle,
.luckyweel-container .valueContainer,
.luckyweel-container .wheelOutline,
.luckyweel-container .wheelText {
    pointer-events: none;
}

/* Toast / Result message */
.luckyweel-container .toast {
    border-radius: 12px;
    opacity: 0;
    background-color: #972E34;
    position: absolute;
    overflow: hidden;
    color: #FFF;
    font-family: inherit;
    font-weight: 400;
    width: 80%;
    max-width: 500px;
    padding: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.luckyweel-container .toast p {
    clear: both;
    font-family: inherit;
    margin: 0;
    font-size: 24px;
    color: #ededed;
    letter-spacing: 0;
    line-height: 32px;
}

/* Result display area */
.luckyweel-container .luckyweel-result {
    margin-top: 20px;
    padding: 15px;
}

.luckyweel-container .luckyweel-result .result-message {
    background: #f0f0f0;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 18px;
    color: #333;
    display: inline-block;
}

.luckyweel-container .luckyweel-result .error-message {
    background: #ffe6e6;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 18px;
    color: #cc0000;
    display: inline-block;
}

/* Wheel text styling */
.luckyweel-container .wheelText {
    text-anchor: start;
    -webkit-user-select: none;
    user-select: none;
}

.luckyweel-container .wheelText tspan {
    text-anchor: middle;
    letter-spacing: 2px;
}

/* Links within the wheel */
.luckyweel-container a:link { color: #F1DC16; }
.luckyweel-container a:visited { color: #F1DC16; }
.luckyweel-container a:hover { color: #ffdd44; }
.luckyweel-container a:active { color: #F1DC16; }

/* Responsive adjustments */
@media only screen and (max-width: 480px) {
    .luckyweel-container {
        padding: 10px;
    }
    
    .luckyweel-container .spinBtn {
        font-size: 1.2rem;
        padding: 12px 20px;
    }
    
    .luckyweel-container .toast p {
        font-size: 16px;
        line-height: 1.5;
    }
    
    .luckyweel-container .luckyweel-result .result-message,
    .luckyweel-container .luckyweel-result .error-message {
        font-size: 14px;
    }
}

@media only screen and (min-width: 481px) and (max-width: 800px) {
    .luckyweel-container .toast p {
        font-size: 20px;
        line-height: 1.8;
    }
}

@media only screen and (min-width: 801px) {
    .luckyweel-container .toast p {
        font-size: 28px;
        line-height: 2.2;
    }
}

/* Animation for toast */
@keyframes luckyweel-fade-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.luckyweel-container .toast.show {
    animation: luckyweel-fade-in 0.3s ease-out forwards;
}

/* Disabled state */
.luckyweel-container.disabled .spinBtn {
    background-color: #999 !important;
    box-shadow: none !important;
    cursor: not-allowed;
}
