.instructions p{
    font-size: 14px;
    text-align: left;
}

.instructions{
    background-color: orange;
    border-radius: 20px;
    margin-bottom: 1em;
    padding-block: 1em;
}

/* ===== GIFT BOX ANIMATIONS ===== */
/* Lucky Draw container */
.lucky-draw-container {
    background-color: rgb(255, 204, 110);
    width: 300px;
    text-align: center;
    position: relative;
    cursor: pointer;
    overflow: visible;
    padding: 20px;
    border-radius: 10%;
}

/* Title */
.title p {
    background-color: rgb(255, 222, 162);
    border-radius: 2em;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 2em;
}

.prize-container{
    font-size: 20px;
    font-weight: bold;
    margin-top: 2em;
}


/* Circular shadow below gift box */
.lucky-draw-container::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 30px;
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.1) 50%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
}

/* Hover bounce keyframes (balloon effect) */
@keyframes hover-bounce-lid {
    0%   { transform: translateY(55px) scale(1); }
    20%  { transform: translateY(40px) scale(1.04,0.96); }
    40%  { transform: translateY(55px) scale(1,1); }
    60%  { transform: translateY(44px) scale(1.02,0.98); }
    80%  { transform: translateY(55px) scale(1,1); }
    100% { transform: translateY(55px) scale(1,1); }
}

@keyframes hover-bounce-box{
    0%   { transform: translateY(0) scale(1); }
    20%  { transform: translateY(-10px) scale(1.04,0.96); }
    40%  { transform: translateY(0) scale(1,1); }
    60%  { transform: translateY(-6px) scale(1.02,0.98); }
    80%  { transform: translateY(0) scale(1,1); }
    100% { transform: translateY(0) scale(1,1); }
}



/* Combined animation for both lid and box */
@keyframes click-cartoon-box {
    0%   { transform: rotate(0deg) scale(1,1); }
    10%  { transform: rotate(10deg) scale(1.08,0.92); }
    20%  { transform: rotate(-10deg) scale(0.92,1.08); }
    30%  { transform: rotate(5deg) scale(1.06,0.94); }
    40%  { transform: rotate(-5deg) scale(0.94,1.06); }
    50%  { transform: rotate(10deg) scale(1.04,0.96) ; }
    60%  { transform: rotate(-10deg) scale(0.96,1.04) ; }
    70%  { transform: rotate(5deg) scale(1.02,0.98) ; }
    80%  { transform: rotate(-5deg) scale(0.98,1.02) ; }
    90%  { transform: rotate(5deg) scale(1.01,0.99) ; }
    100% { transform: rotate(-5) scale(1,1); }
}

@keyframes click-cartoon-lid {
    0%   { transform: translateY(50px) rotate(0deg) scale(1,1); }
    10%  { transform: translateY(50px) rotate(10deg) scale(1.08,0.92); }
    20%  { transform: translateY(50px) rotate(-10deg) scale(0.92,1.08); }
    30%  { transform: translateY(50px) rotate(5deg) scale(1.06,0.94); }
    40%  { transform: translateY(50px) rotate(-5deg) scale(0.94,1.06)t; }
    50%  { transform: translateY(50px) rotate(10deg) scale(1.04,0.96) t; }
    60%  { transform: translateY(50px) rotate(-10deg) scale(0.96,1.04); }
    70%  { transform: translateY(50px) rotate(5deg) scale(1.02,0.98); }
    80%  { transform: translateY(50px) rotate(-5deg) scale(0.98,1.02); }
    90%  { transform: translateY(50px) rotate(5deg) scale(1.01,0.99); }
    100% { transform: translateY(50px) rotate(-5) scale(1,1); }
}

/* Deflate & inflate after click */
@keyframes deflate-inflate {
    0%   { transform: scale(1,1) translateY(0); }
    25%  { transform: scale(0.8,1.2) translateY(5px); }
    50%  { transform: scale(1.2,0.8) translateY(-5px); }
    75%  { transform: scale(0.9,1.1) translateY(3px); }
    100% { transform: scale(1,1) translateY(0); }
}

/* Lid stretch + bouncy open */
@keyframes lid-open {
    0%   { transform: translateY(0) scale(1,1);}
    100% { transform: translateY(-50px) scale(1,1);}
}

/* Apply the animation when container is opened */
.lucky-draw-container.open #Lid {
    animation: lid-open-bounce 1s cubic-bezier(.68,-0.55,.27,1.55) forwards;
}



/* ===== CONFETTI ANIMATION ===== */
.confetti-container {
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
}

.confetti {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: #f54242;
    opacity: 0.9;
    border-radius: 50%;
    animation: confetti-fall 1s forwards;
}

@keyframes confetti-fall {
    0% { transform: translate(0,0) rotate(0deg); opacity: 1; }
    100% { transform: translate(var(--x), var(--y)) rotate(720deg); opacity: 0; }
}

/* ===== PRIZE POPUP STYLES ===== */


/* Prize Popup Overlay */
.prize-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    display: none;
    place-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    z-index: 100;
    backdrop-filter: blur(2px);
    overflow-y: auto;
}

/* Show popup */
.prize-popup.show {
    display: grid;
    opacity: 1;
    pointer-events: auto;
}

/* Popup card */
.popup-card {
    background: #fff;
    padding-left: 1.5em;
    padding-right: 1.5em;
    padding-bottom: 0.5em;
    padding-top: 1em; /* Added padding-top to make room for floating lid */
    border-radius: 20px;
    text-align: center;
    transform: scale(0.7);
    animation: popup-bounce 0.6s cubic-bezier(.34,1.56,.64,1) forwards;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
    max-width: min(600px, 95vw); /* Responsive max-width */
    width: 90%;
    margin: 1em auto;
    position: relative;
    max-height: calc(100vh - 10vh);
    overflow: visible; /* Changed to visible to allow lid to extend outside */
}

/* Webkit scrollbar styling */
.popup-card::-webkit-scrollbar {
    width: 6px;
}

.popup-card::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 10px;
}

.popup-card::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.popup-card::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
}

/* Prize popup gift box */
.prize-popup-gift-box {
    position: relative;
    margin-bottom: 1em;
}

.prize-popup-gift-box img {
    width: 80px;
    height: auto;
    margin: 0 10px;
}

.prize-popup-gift-box p{
    margin: 0;
    margin-bottom: 0;
}

.prize-popup-gift-box h2{
    margin: 0;
    margin-bottom: -6px;
}

#prizePopupLid{
    width: clamp(150px, 25vw, 200px); /* Responsive width: min 150px, max 200px, scales with viewport */
    padding: 0;
    margin: 0;
    margin-bottom: -3em;
    transform: translateY(-4em); /* Adjusted for better mobile spacing */
    z-index: 101;
    position: relative;
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.3));
}

/* 3D effect for popup lid - appears to float above card */
.prize-popup-gift-box {
    position: relative;
    overflow: visible;
}

.prize-popup-gift-box::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    height: 40px;
    background: radial-gradient(ellipse 60% 30% at 50% 20%, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.05) 50%, transparent 70%);
    border-radius: 50%;
    z-index: 1000;
    pointer-events: none;
}

#prizePopupBox{
    width: clamp(120px, 22vw, 180px); /* Responsive width */
    padding: 0;
    margin: 0;
    
    filter: drop-shadow(0 6px 12px rgba(0,0,0,0.3));
}

#prizeText{
    font-weight: bold;
}

/* Popup bounce animation */
@keyframes popup-bounce {
    0%   { transform: scale(0.6); }
    60%  { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.popup-card h2 {
    font-size: clamp(20px, 4vw, 24px); /* Responsive font size */
    margin-bottom: 0.5em;
    margin-top: -1em; /* Responsive negative margin */
    color: #2c3e50;
    font-weight: 700;
}

.popup-card p {
    font-size: 16px;
    margin-bottom: 1em;
    color: #34495e;
    line-height: 1.4;
}

/* User info section */

.user-info p {
    font-size: 14px;
    margin: 0.3em 0;
    color: #495057;
    font-weight: 500;
}

.user-info p strong {
    color: #2c3e50;
    font-weight: 600;
}

/* ===== INSTRUCTIONS & FORM ELEMENTS ===== */
/* Instructions section */
.instructions {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid #f39c12;
    border-radius: 12px;
    padding: 1em;
    text-align: left;
    margin: 0;
}

.instructions ol {
    margin: 0;
    padding-left: 1.2em;
}

.instructions li {
    margin-bottom: 0.8em;
    line-height: 1.5;
    color: #8b4513;
    font-size: 15px;
}

.instructions li:last-child {
    margin-bottom: 0;
}

/* Checkbox and label styling */
.checkbox-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5em;
    padding: 0.8em;
    padding-top: 1em;
}

.checkbox-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    accent-color: #f39c12;
    cursor: pointer;
}

.checkbox-container label {
    font-size: 16px;
    color: #495057;
    cursor: pointer;
    line-height: 1.4;
    margin-right: 1em;
    font-weight: 500;
}

/* ===== BUTTONS ===== */
.popup-card button {
    padding: 0.7em 2em;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.popup-card button:hover:not(:disabled) {
    background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.4);
}

.popup-card button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== LOGIN & STATUS MESSAGES ===== */
/* Login required and already drawn styles */
.lucky-draw-login-required,
.lucky-draw-already-drawn,
.lucky-draw-access-denied {
    text-align: center;
    padding: 3em 2em;
    margin: 2em auto;
}

.lucky-draw-login-required p,
.lucky-draw-already-drawn p,
.lucky-draw-access-denied p {
    font-size: 20px;
    margin-bottom: 1.5em;
    color: white;
    font-weight: 500;
}

.lucky-draw-already-drawn a{
    color: #ea8221;
}

.lucky-draw-access-denied p:first-child {
    color: #dc3545;
    font-weight: 600;
}

.lucky-draw-login-required h3{
    color: white;
    font-weight: bold;
}

/* ===== LOGIN FORM ELEMENTS ===== */
/* Participant Login Form */
.participant-login-form {
    margin: 0 auto;
}



.participant-login-form p {
    margin-bottom: 1em;
}

.participant-login-form label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: 600;
    color: white;
}

/* Target your plugin form specifically */
.lucky-draw-login-required .participant-login-form input[type="email"],
.lucky-draw-login-required .participant-login-form input[type="password"] {
    max-width: 30em !important;
    width: 100% !important;
    height: 50px !important; /* Increased from 40px */
    padding: 12px 16px !important;
    border: 2px solid #dee2e6 !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
    box-sizing: border-box !important;
}

/* Fix the labels too */
.lucky-draw-login-required .participant-login-form label {
    display: block !important;
    margin-bottom: 8px !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    color: white !important;
}

.participant-login-form input[type="email"]:focus,
.participant-login-form input[type="password"]:focus {
    outline: none;
    border-color: #ea8221;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.1);
}

.participant-login-form .login-submit {
    background-color: #ea8221 !important;
    color: white !important;
    padding: 0.8em, 3em !important;
    border: none !important;
    border-radius: 5px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    max-width: 400px !important;
    max-height: 45px !important;
}

.participant-login-form .login-submit:hover {
    background: #c26a1d;
    transform: translateY(-2px);
}

.participant-login-form .error {
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 0.8em;
    border-radius: 8px;
    margin-top: 1em;
    text-align: center;
}

.logout-link {
    display: inline-block;
    color: #007cba;
    text-decoration: none;
    font-weight: 600;
    margin-top: 1em;
}

.logout-link:hover {
    color: #005a87;
    text-decoration: underline;
}

/* ===== LANDING PAGE STYLES ===== */
.lucky-draw-landing {
    text-align: center;
    background: transparent;
    padding: clamp(1.5em, 8vw, 3em) clamp(1em, 4vw, 2em); /* Responsive padding */
    margin: 2em auto;
    position: relative;
    transition: opacity 0.5s ease;
}

/* Dimmed background effect */
.lucky-draw-landing.dimmed {
    opacity: 0.3;
}

.landing-content h2 {
    font-size: 32px;
    color: white;
    margin-bottom: 1em;
    font-weight: 700;
}

.landing-content p {
    font-size: 18px;
    color: white;
    margin-bottom: 2em;
    line-height: 1.5;
}

.landing-form {
    margin-bottom: 1.5em;
}

.claim-now-btn {
    background-color: white;
    color: black;
    border: none;
    padding: 0.8em 2em;
    border-radius: 5px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    text-decoration: none;

}

.claim-now-btn:hover {
    background-color: rgb(212, 212, 212);
    color: black;
}

.landing-note {
    font-size: 16px;
    color: #6c757d;
    font-style: italic;
}

/* ===== LANDING PAGE GIFT BOX ===== */
.landing-gift-box {
    margin-bottom: 2em;
    position: relative;
}

.landing-gift-box img{
    display: block;
    margin: 0 auto;
}

#LandingLid{
    width: 240px;
    transform: translateY(55px);
    position: relative;
    z-index: 4;
}

#LandingLid:hover{
    z-index: 5 !important;
}

#LandingBox{
    width: 180px;
    position: relative;
    z-index: 2;
}

#LandingBox:hover{
    z-index: 2 !important;
}

/* Landing gift box shadow */
.landing-gift-box::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 30px;
    
    /* Gradient background */
    background: radial-gradient(
        ellipse at center,
        rgba(0, 0, 0, 0.2) 0%,
        rgba(0, 0, 0, 0.08) 40%,
        transparent 70%
    );
    
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

/* ===== FADE-OUT ANIMATIONS ===== */
@keyframes fade-out-up {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-30px);
    }
}

/* Apply animations when gift box is opened */
.landing-gift-box.open #LandingLid {
    animation: lid-open-bounce 1s cubic-bezier(.68,-0.55,.27,1.55) forwards;
}

/* ===== MOBILE RESPONSIVE ADJUSTMENTS ===== */
/* Smaller screens: Adjust popup lid positioning */
@media (max-width: 768px) {
    #prizePopupLid {
        transform: translateY(-3em); /* Less vertical movement on mobile */
        width: clamp(120px, 30vw, 180px); /* Smaller on mobile */
    }

    #prizePopupBox {
        width: clamp(100px, 25vw, 150px);
    }

    .popup-card h2 {
        margin-top: -0.5em; /* Less negative margin on mobile */
    }

    .popup-card {
        padding-left: 1em;
        padding-right: 1em;
        padding-top: 0.5em; /* Less top padding on mobile */
    }
}

/* Very small screens */
@media (max-width: 480px) {
    #prizePopupLid {
        width: clamp(100px, 35vw, 150px);
    }

    #prizePopupBox {
        width: clamp(80px, 30vw, 120px);
    }

    .lucky-draw-landing {
        margin: 1em auto;
        padding: 1em;
    }

    .checkbox-container label{
        font-size: small;
    }

    #closePopup{
        transform: scale(80%);
    }

    .instructions li{
        font-size: small;
    }

    #prizeImage{
        width: 80px;
        height: 80px;
    }

    .lucky-draw-login-required p{
        font-size: 14px;
    }

    .lucky-draw-login-required input[type="submit"]{
        transform: scale(80%);
    }

    .lucky-draw-login-required input[type="submit"]:hover{
        transform: scale(80%);
    }

    .lucky-draw-login-required input[type="email"], input[type="password"]{
        height: 40px;
    }
}