/* WP Gift Wheel - Frontend Styles */

:root {
    --gw-primary: #5865F2;
    --gw-success: #3BA55D;
    --gw-danger: #ED4245;
    --gw-white: #FFFFFF;
    --gw-overlay: rgba(0, 0, 0, 0.7);
}

/* Floating Button */
.gw-float-button {
    position: fixed;
    z-index: 99999;
    background: linear-gradient(to right,#faab08,#d42611);
    color: var(--gw-white);
    border: none;
    border-radius: 50px;
    padding: 16px 28px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    /* box-shadow: 0 8px 24px rgba(88, 101, 242, 0.4); */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.gw-float-button:hover {
    transform: translateY(-3px);
    /* box-shadow: 0 12px 32px rgba(88, 101, 242, 0.5); */
}

.gw-float-button:active {
    transform: translateY(-1px);
}

/* Button Positions */
.gw-float-button.bottom-right {
    bottom: 30px;
    right: 30px;
}

.gw-float-button.bottom-left {
    bottom: 50%;
    transform: translateY(-50%);
    left: 30px;
}

.gw-float-button.top-right {
    top: 30px;
    right: 30px;
}

.gw-float-button.top-left {
    top: 30px;
    left: 30px;
}

/* Popup Overlay */
.gw-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gw-overlay);
    z-index: 100000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gw-overlay.active {
    display: flex;
    opacity: 1;
}

.gw-overlay.active .gw-popup {
    /* transform: scale(1); */
    opacity: 1;
}

/* Popup Container */
.gw-popup {
    position: absolute;
    background: var(--gw-white);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 90%;
    max-height: 90vh;
    overflow: hidden;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gw-popup.position-left {
    top: 0;
    left: 0;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    transform: translateX(-100%);
    opacity: 1;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); /* Bounce effect */
}

.gw-popup.position-left.active {
    transform: translateX(0);
}

/* Right - Slide với bounce nhẹ */
.gw-popup.position-right {
    top: 0;
    right: 0;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    transform: translateX(100%);
    opacity: 1;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); /* Bounce effect */
}

.gw-popup.position-right.active {
    transform: translateX(0);
}

/* Full - Fade + Scale mượt */
.gw-popup.position-full {
    top: 50%;
    left: 50%;
    width: 90%;
    max-width: 1000px;
    transform: translate(-50%, -50%) scale(0.85);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gw-popup.position-full.active {
    transform: translate(-50%, -50%) scale(1);
}

/* Close Button */
.gw-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.gw-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

.gw-close::before,
.gw-close::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background: #fff;
}

.gw-close::before {
    transform: rotate(45deg);
}

.gw-close::after {
    transform: rotate(-45deg);
}

/* Popup Content */
.gw-popup-content {
    display: flex;
    height: 100%;
}

.gw-popup-left {
    flex: 1;
    padding: 60px 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.gw-popup-right {
    flex: 1;
    padding: 60px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Full Mode Layout */
.gw-popup.position-full .gw-popup-content {
    flex-direction: row;
}

/* Wheel Container */
.gw-wheel-container {
    position: relative;
    width: 400px;
    height: 400px;
    box-shadow: 0 10px 30px 0 rgba(0, 0, 0, 0.21);
    border-radius: 50%;
}

.gw-wheel-canvas {
    width: 100%;
    height: 100%;
}
.gw-prize-label{
    font-size: 18px;
    strong{
        color: red;
    }
}
.gw-btn-copy {
    padding: 8px 16px;
   background: rgba(16, 185, 129, 0.1);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.2);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-left: 5px;
}

.gw-btn-copy:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.gw-btn-copy:active {
    transform: translateY(0);
}

.gw-btn-copy:disabled {
    background: #ccc;
    cursor: not-allowed;
}
.gw-wheel-pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid #FFD700;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    z-index: 10;
}

.gw-wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: var(--gw-white);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    z-index: 5;
}

/* Form Section */
.gw-form-section {
    color: var(--gw-white);
}

.gw-form-title {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 12px;
    line-height: 1.2;
    color: #fff;
    max-width: 700px;
}

.gw-form-title span {
    color: #FFD700;
}

.gw-form-description {
    font-size: 16px;
    margin-bottom: 32px;
    opacity: 0.9;
    line-height: 1.6;
}

.gw-form {
    margin-bottom: 24px;
}

.gw-input-group {
    margin-bottom: 16px;
    display: flex;
}

.gw-input {
    width: 100%;
    padding: 16px 20px !important;
    font-size: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.9) !important;
    transition: all 0.3s ease;
}

.gw-input:focus {
    outline: none;
    border-color: #FFD700;
    background: var(--gw-white);
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.2);
}

.gw-input::placeholder {
    color: #999;
}

.gw-submit-btn {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    font-weight: 700;
    background: #FFD700;
    color: #333;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gw-submit-btn:hover {
    background: #FFC700;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.4);
}

.gw-submit-btn:active {
    transform: translateY(0);
}

.gw-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.gw-rules {
    font-size: 14px;
    /* opacity: 0.8; */
    color: #fff;
}

.gw-rules h4 {
    margin-bottom: 0px;
    font-size: 16px;
     color: #fff;
     padding: 0px;
}

.gw-rules ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.gw-rules li {
    padding: 6px 0 0px;
    padding-left: 24px;
    position: relative;
}

.gw-rules li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    color: #FFD700;
    font-weight: bold;
}

/* Result Modal */
.gw-result-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: var(--gw-white);
    border-radius: 24px;
    padding: 48px;
    text-align: center;
    z-index: 100001;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.gw-result-modal.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.gw-result-icon {
    font-size: 80px;
    margin-bottom: 24px;
}

.gw-result-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 16px;
    color: #333;
}

.gw-result-message {
    font-size: 18px;
    color: #666;
    margin-bottom: 24px;
    line-height: 1.6;
}

.gw-coupon-code {
    display: inline-block;
    padding: 16px 32px;
    background: linear-gradient(to right,#faab08,#d42611);
    color: var(--gw-white);
    font-size: 24px;
    font-weight: 700;
    border-radius: 12px;
    margin-bottom: 24px;
    letter-spacing: 2px;
}

.gw-result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-direction: column;
}

.gw-btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gw-btn-primary {
    background: var(--gw-primary);
    color: var(--gw-white);
}

.gw-btn-primary:hover {
    background: #4752C4;
    transform: translateY(-2px);
}

.gw-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.gw-btn-secondary:hover {
    background: #e0e0e0;
}

/* Confetti Animation */
@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(360deg);
    }
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #FFD700;
    top: -10px;
    animation: confetti-fall 3s linear infinite;
    z-index: 100002;
}

/* Spinning Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.gw-wheel-container.spinning .gw-wheel-canvas {
    animation: spin 3s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .gw-popup {
        border-radius: 16px;
        max-width: 100%;
        max-height: 100vh;
    }
    
    .gw-popup-content {
        flex-direction: column !important;
    }
    .gw-popup.position-full{
        width: 100%;
    }
    .gw-popup-left,
    .gw-popup-right {
        padding: 30px 24px 0px;
    }
    .gw-popup-right{
        padding-top: 0px;
    }
    .gw-wheel-container {
        width: 300px;
        height: 300px;
    }
    
    .gw-form-title {
        font-size: 23px;
        margin-top: 10px;
        padding: 0px;
    }
    
    .gw-form-description {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .gw-float-button {
        padding: 12px 20px;
        font-size: 14px;
        bottom: 20px !important;
        left: 0px !important;
    }
    
    .gw-result-modal {
        padding: 32px 24px;
        max-width: 300px;
    }
    
    .gw-result-icon {
        font-size: 60px;
    }
    
    .gw-result-title {
        font-size: 24px;
    }
    .gw-rules{
        max-height: 100px;
        overflow-y: scroll;
    }
}

/* Loading State */
.gw-loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--gw-white);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
/* Button Display Modes */

/* Base Button Styles */
.gw-float-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Image Only Mode */
.gw-float-button.mode-image {
    padding: 8px;
    border-radius: 50%;
    width: auto;
    height: auto;
    background: transparent;
}

.gw-float-button.mode-image .gw-button-image {
    width: 100px;
    height: 100px;
    object-fit: contain;
    display: block;
    background: transparent;
}

.gw-float-button.mode-image .gw-button-text {
    display: none;
}

/* Text Only Mode */
.gw-float-button.mode-text {
    padding: 16px 28px;
}

.gw-float-button.mode-text .gw-button-image {
    display: none;
}

.gw-float-button.mode-text .gw-button-text {
    display: block;
}

/* Both Mode (Image + Text) */
.gw-float-button.mode-both {
    padding: 12px 24px;
    flex-direction: column;
    border-radius: 16px;
}

.gw-float-button.mode-both .gw-button-image {
    width: 50px;
    height: 50px;
    object-fit: contain;
    display: block;
}

.gw-float-button.mode-both .gw-button-text {
    display: block;
    font-size: 14px;
    margin-top: 4px;
}

/* Mobile Responsive for Button Modes */
@media (max-width: 768px) {
    .gw-float-button.mode-image .gw-button-image {
        /* width: 50px;
        height: 50px; */
    }

    .gw-float-button.mode-text {
        padding: 12px 20px;
        font-size: 14px;
    }

    .gw-float-button.mode-both {
        padding: 10px 18px;
    }

    .gw-float-button.mode-both .gw-button-image {
        width: 40px;
        height: 40px;
    }

    .gw-float-button.mode-both .gw-button-text {
        font-size: 12px;
    }
}
/* Heartbeat Animation for Button */
@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}
@keyframes pulse{
    0% {
    -webkit-transform: scale(1);
    -ms-transform: scale(1);
    transform: scale(1);
    }
    50% {
        -webkit-transform: scale(1.1);
        -ms-transform: scale(1.1);
        transform: scale(1.1);
    }
    100% {
        -webkit-transform: scale(1);
        -ms-transform: scale(1);
        transform: scale(1);
    }
}
@keyframes pulse2{
    0% {
    -webkit-transform: scale(1);
    -ms-transform: scale(1);
    transform: scale(1);
    }
    50% {
        -webkit-transform: scale(1.05);
        -ms-transform: scale(1.05);
        transform: scale(1.05);
    }
    100% {
        -webkit-transform: scale(1);
        -ms-transform: scale(1);
        transform: scale(1);
    }
}
@keyframes wobble {
    0% {
    -webkit-transform: translateX(0);
    -ms-transform: translateX(0);
    transform: translateX(0);
}
15% {
    -webkit-transform: translateX(-25%) rotate(-5deg);
    -ms-transform: translateX(-25%) rotate(-5deg);
    transform: translateX(-25%) rotate(-5deg);
}
30% {
    -webkit-transform: translateX(20%) rotate(3deg);
    -ms-transform: translateX(20%) rotate(3deg);
    transform: translateX(20%) rotate(3deg);
}
45% {
    -webkit-transform: translateX(-15%) rotate(-3deg);
    -ms-transform: translateX(-15%) rotate(-3deg);
    transform: translateX(-15%) rotate(-3deg);
}
}
@keyframes flash {
    0%, 100%, 50% {
    opacity: 1;
}
25%, 75% {
    opacity: 0;
}
}
.gw-float-button.pulse {
    animation: pulse 1.5s ease-in-out infinite;
}
.gw-submit-btn {
    animation: pulse2 1.5s ease-in-out infinite;
}
img.gw-decor-image1 {
    width: 100%;
    position: absolute;
    top: -109px;
}
img.gw-decor-image2 {
    position: absolute;
    bottom: 0px;
    width: 30%;
}
img.gw-decor-image3 {
    position: absolute;
    z-index: -1;
    bottom: 0px;
    left: 30%;
    width: 40%;
    animation: wobble 15s ease-in-out 0s infinite;
}
img.gw-decor-image4{
    position: absolute;
   animation-name: flash;
    animation-delay: 0s;
    animation-duration: 11s;
    animation-iteration-count: infinite;
}

/* ============================================
   Winners Shortcode — [gift_wheel_winners]
   ============================================ */
.gw-winners-wrap {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 100%;
    margin: 0 auto;
}

.gw-winners-title {
    font-size: 22px;
    font-weight: 700;
    color: #222;
    margin-bottom: 16px;
}

.gw-winners-count {
    color: #d42611;
}

/* Search bar */
.gw-winners-search-wrap {
    margin-bottom: 14px;
}

.gw-winners-search {
    width: 100%;
    padding: 11px 16px;
    font-size: 14px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    background: #fff;
    color: #333;
}

.gw-winners-search:focus {
    border-color: #faab08;
    box-shadow: 0 0 0 3px rgba(250, 171, 8, 0.15);
}

.gw-winners-search::placeholder {
    color: #bbb;
}

/* Table wrapper with loading state */
.gw-winners-table-wrap {
    transition: opacity 0.2s ease;
    overflow-x: auto;
}

.gw-winners-table-wrap.gw-winners-loading {
    opacity: 0.4;
    pointer-events: none;
}

/* Table */
.gw-winners-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
}

.gw-winners-table thead tr {
    background: linear-gradient(to right, #faab08, #d42611);
    color: #fff;
}

.gw-winners-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.gw-winners-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s ease;
}

.gw-winners-table tbody tr:last-child {
    border-bottom: none;
}

.gw-winners-table tbody tr:hover {
    background: #fdf6ec;
}

.gw-winners-table td {
    padding: 11px 16px;
    color: #444;
    vertical-align: middle;
}

.gw-winners-table td:first-child {
    color: #999;
    font-size: 13px;
    width: 40px;
}

.gw-winners-prize {
    color: #d42611;
    font-weight: 600;
}

.gw-winners-empty {
    text-align: center;
    color: #aaa;
    padding: 32px 16px !important;
}

/* Pagination */
.gw-winners-pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.gw-winners-page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #e0e0e0;
    background: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #444;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gw-winners-page-btn:hover:not(.active):not(.disabled):not(:disabled) {
    background: #fdf6ec;
    border-color: #faab08;
    color: #d42611;
}

.gw-winners-page-btn.active {
    background: linear-gradient(to right, #faab08, #d42611);
    border-color: transparent;
    color: #fff;
    cursor: default;
}

.gw-winners-page-btn.disabled,
.gw-winners-page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.gw-winners-prev,
.gw-winners-next {
    font-size: 18px;
    font-weight: 400;
}

.gw-winners-ellipsis {
    color: #aaa;
    font-size: 14px;
    padding: 0 2px;
    user-select: none;
}

/* Mobile */
@media (max-width: 600px) {
    .gw-winners-table thead th:nth-child(2),
    .gw-winners-table td:nth-child(2) {
        display: none;
    }

    .gw-winners-table td,
    .gw-winners-table th {
        padding: 9px 10px;
        font-size: 13px;
    }
}