/**
 * 插件的所有公共区域的特定样式
 *
 * @package    Spin_The_Wheel
 * @subpackage Spin_The_Wheel/public/css
 */

/* 转盘容器 */
.spinwheel-container {
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    box-sizing: border-box;
    padding: 30px;
    margin-bottom: 40px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15), 0 5px 15px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

/* 弹窗模式下的转盘容器 */
.spinwheel-container[data-display-type="popup"] {
    padding: 0;
    background: none;
    box-shadow: none;
    overflow: visible;
}

/* 弹窗触发按钮 */
.spinwheel-trigger-button {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, #f5af19, #f12711);
    color: white;
    font-weight: bold;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.spinwheel-trigger-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.spinwheel-trigger-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

/* 弹窗样式 */
.spinwheel-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.spinwheel-popup.active {
    opacity: 1;
    visibility: visible;
}

.spinwheel-popup-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: popup-appear 0.5s forwards;
}

@keyframes popup-appear {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.spinwheel-popup-close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.spinwheel-popup-close:hover {
    color: #f12711;
    transform: rotate(90deg);
}

/* 添加背景图案 */
.spinwheel-container:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23000000' fill-opacity='0.03' fill-rule='evenodd'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.3;
    z-index: 0;
    pointer-events: none;
}

/* 标题 */
.spinwheel-title {
    font-size: 32px;
    font-weight: 800;
    color: #2c3e50;
    margin-bottom: 30px;
    text-align: center;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
    letter-spacing: -0.5px;
}

.spinwheel-title:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #9b59b6);
    border-radius: 4px;
}

/* 转盘容器 */
.spinwheel-wheel-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: auto;
    margin: 0 auto 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 添加指针 - 确保它始终指向正确的位置 */
.spinwheel-wheel-container:after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 25px solid #FF0000;
    z-index: 30;
    filter: drop-shadow(0px 2px 3px rgba(0, 0, 0, 0.5));
}

/* 转盘画布 */
.spinwheel-canvas {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
    transform-origin: center center;
    transition: transform 5s cubic-bezier(0.17, 0.67, 0.21, 0.99);
    will-change: transform;
}

/* 为转盘添加金属边框效果 */
.spinwheel-wheel-container:before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 10px);
    height: calc(100% - 10px);
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,0.8) 0%, rgba(200,200,200,0.2) 50%, rgba(150,150,150,0.5) 100%);
    box-shadow: 0 0 0 10px rgba(0,0,0,0.08), inset 0 0 20px rgba(0,0,0,0.2);
    z-index: -1;
    pointer-events: none;
}

/* 中心按钮样式 */
.spinwheel-center-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #f5af19, #f12711);
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2), inset 0 0 8px rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    border: none;
    outline: none;
    transition: all 0.3s ease;
    overflow: hidden;
}

.spinwheel-center-button span {
    color: white;
    font-weight: bold;
    font-size: 14px;
    line-height: 1.2;
    text-align: center;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    max-width: 90%;
}

.spinwheel-center-button:hover {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3), inset 0 0 12px rgba(255, 255, 255, 0.6);
}

.spinwheel-center-button:active {
    transform: translate(-50%, -50%) scale(0.95);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2), inset 0 0 5px rgba(255, 255, 255, 0.4);
}

/* 按钮加载状态 */
.spinwheel-center-button.loading {
    /* 注释掉这些样式，防止按钮变白
    opacity: 0.7;
    pointer-events: none;
    */
}

.spinwheel-center-button.loading:after {
    /* 注释掉这些样式，移除加载动画
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    animation: spinwheel-button-loading 0.6s infinite linear;
    */
    display: none; /* 完全隐藏加载指示器 */
}

@keyframes spinwheel-button-loading {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 结果显示区域 */
.spinwheel-result {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    width: 90%;
    max-width: 500px;
    text-align: center;
}

/* 结果窗口装饰效果 */
.spinwheel-result:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    border-radius: 15px;
    pointer-events: none;
}

/* 激活结果显示 */
.spinwheel-result.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.spinwheel-result-title {
    font-size: 36px;
    font-weight: 800;
    color: #2c3e50;
    margin-bottom: 25px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    display: inline-block;
    letter-spacing: -0.5px;
}

.spinwheel-result-title:after {
    content: '🎉';
    position: absolute;
    top: -15px;
    right: -35px;
    font-size: 28px;
    transform: rotate(15deg);
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
    animation: celebrateRight 1s ease-in-out infinite;
}

.spinwheel-result-title:before {
    content: '🎉';
    position: absolute;
    top: -15px;
    left: -35px;
    font-size: 28px;
    transform: rotate(-15deg);
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
    animation: celebrateLeft 1s ease-in-out infinite;
}

@keyframes celebrateRight {
    0%, 100% { transform: rotate(15deg); }
    50% { transform: rotate(30deg); }
}

@keyframes celebrateLeft {
    0%, 100% { transform: rotate(-15deg); }
    50% { transform: rotate(-30deg); }
}

.spinwheel-result-content {
    font-size: 20px;
    line-height: 1.6;
    color: #444;
    margin-bottom: 35px;
    padding: 20px;
    background: rgba(255,255,255,0.8);
    border-radius: 15px;
    border-left: 5px solid #3498db;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    position: relative;
}

.spinwheel-close-button {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    outline: none;
    box-shadow: 0 8px 15px rgba(244, 67, 54, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    margin-top: 30px;
}

.spinwheel-close-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 20px rgba(244, 67, 54, 0.4);
    background: linear-gradient(135deg, #ff5252, #f44336);
}

.spinwheel-close-button:active {
    transform: translateY(2px);
    box-shadow: 0 5px 10px rgba(244, 67, 54, 0.3);
}

/* 错误信息 */
.spinwheel-error {
    color: #e74c3c;
    border-left: 5px solid #e74c3c;
    background-color: #fef0f0;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    font-weight: 500;
}

/* 遮罩层样式 */
.spinwheel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    visibility: hidden;
    cursor: pointer;
}

/* 自动隐藏触发按钮 */
.spinwheel-trigger-auto-hide {
    display: none !important;
}

.spinwheel-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 加载指示器 */
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 旋转动画 */
.spinning {
    animation: wheel-shine 5s linear;
}

@keyframes wheel-shine {
    0%, 100% { filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.8)); }
    25%, 75% { filter: drop-shadow(0 0 15px rgba(255, 255, 255, 1)); }
    50% { filter: drop-shadow(0 0 25px rgba(255, 255, 255, 1)); }
}

/* 响应式设计 */
@media only screen and (max-width: 600px) {
    .spinwheel-title {
        font-size: 26px;
    }
    
    .spinwheel-result {
        padding: 30px;
        width: 85%;
    }
    
    .spinwheel-result-title {
        font-size: 30px;
    }
    
    .spinwheel-result-content {
        font-size: 18px;
        padding: 15px;
    }
}

/* 添加丰富的动画效果 */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

.pulse-animation {
    animation: pulse 2s ease-in-out infinite;
}

/* 未中奖和中奖样式区别 */
.spinwheel-result.win .spinwheel-result-title {
    color: #27ae60;
}

.spinwheel-result.win .spinwheel-result-title:after {
    content: '🎉';
}

.spinwheel-result.win .spinwheel-result-title:before {
    content: '🎉';
}

.spinwheel-result.no-win .spinwheel-result-title {
    color: #e74c3c;
}

.spinwheel-result.no-win .spinwheel-result-title:after,
.spinwheel-result.no-win .spinwheel-result-title:before {
    display: none; /* 不显示庆祝表情 */
}

.spinwheel-result.no-win .spinwheel-result-content {
    border-left-color: #e74c3c;
}

.spinwheel-result.no-win .spinwheel-close-button {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 8px 15px rgba(231, 76, 60, 0.3);
}

.spinwheel-result.no-win .spinwheel-close-button:hover {
    box-shadow: 0 12px 20px rgba(231, 76, 60, 0.4);
}

.spinwheel-result.no-win .spinwheel-close-button:active {
    box-shadow: 0 5px 10px rgba(231, 76, 60, 0.3);
}

/* 中奖码容器样式 */
.spinwheel-code-container {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #3498db;
    text-align: center;
}

.spinwheel-code-label {
    font-size: 16px;
    color: #333;
    margin-bottom: 10px;
    font-weight: bold;
}

.spinwheel-code {
    font-size: 24px;
    font-weight: bold;
    color: #e74c3c;
    letter-spacing: 2px;
    background-color: #fff;
    padding: 10px 15px;
    border-radius: 5px;
    display: inline-block;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border: 1px solid #ddd;
    font-family: monospace;
}

.spinwheel-code-tip {
    font-size: 14px;
    color: #7f8c8d;
    margin-top: 10px;
    font-style: italic;
} 