/* Gift Reveal UI Styles */
#header2 {
    display:none;
}
.rcgm-gifts-container {
    display: none;
    text-align: center;
    padding: 30px 20px;
    /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    /*border-radius: 20px;*/
    margin: 20px 0;
    /*box-shadow: 0 20px 40px rgba(0,0,0,0.1);*/
}

.rcgm-gifts-title {
    font-family: "Montserrat", Sans-serif;
    font-size: 26px;
    color: #242424;
    margin-bottom: 10px;
    font-weight: 600;
}

.rcgm-gifts-subtitle {
    color: #242424;
    font-size: 16px;
    font-weight: 300;
    margin-bottom:50px;
}

.rcgm-gifts-grid {
    display: flex;
    /*grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));*/
    justify-content:center;
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

#canes-gift-container {
    margin-bottom:100px;
}

.rcgm-gift-item {
    perspective: 1000px;
    cursor: pointer;
}

.rcgm-gift-box {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 0 auto;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.rcgm-gift-box.flipped {
    transform: rotateY(180deg);
}

.rcgm-gift-box-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.rcgm-gift-front, .rcgm-gift-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.rcgm-gift-front {
    background: linear-gradient(45deg, #ff6b6b, #ff8e8e);
    /*border: 3px solid #fff;*/
}

.rcgm-gift-back {
    background: white;
    transform: rotateY(180deg);
    padding: 15px;
}

.rcgm-gift-image {
    max-width: 120px;
    max-height: 120px;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.rcgm-gift-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0;
    line-height: 1.3;
}

.rcgm-gift-prompt {
    color: white;
    font-size: 14px;
    margin-top: 10px;
    opacity: 0.9;
    font-weight: 500;
}

.rcgm-lottie-container {
    width: 140px;
    height: 140px;
}

.rcgm-celebration-message {
    background: rgba(255,255,255,0.95);
    padding: 20px;
    border-radius: 15px;
    margin: 20px auto;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: slideUp 0.6s ease-out;
}

.rcgm-celebration-title {
    color: #333;
    font-size: 1.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.rcgm-celebration-text {
    color: #242424;
    font-size: 1.1em;
    margin: 0;
    margin-bottom: 30px;
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes staggerItem {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.rcgm-gift-item {
    animation: staggerItem 0.6s ease-out both;
}

.rcgm-gift-item:nth-child(1) { animation-delay: 0.1s; }
.rcgm-gift-item:nth-child(2) { animation-delay: 0.2s; }
.rcgm-gift-item:nth-child(3) { animation-delay: 0.3s; }
.rcgm-gift-item:nth-child(4) { animation-delay: 0.4s; }
.rcgm-gift-item:nth-child(5) { animation-delay: 0.5s; }
.rcgm-gift-item:nth-child(6) { animation-delay: 0.6s; }

/* Hover Effects */
/*.rcgm-gift-item:hover .rcgm-gift-front {*/
/*    transform: translateY(-5px);*/
/*    box-shadow: 0 15px 35px rgba(0,0,0,0.3);*/
/*}*/

.rcgm-gift-item:hover .rcgm-gift-prompt {
    transform: scale(1.05);
}

/* Loading State */
.rcgm-loading {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .rcgm-gifts-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
        padding: 10px;
    }
    
    .rcgm-gift-box {
        width: 180px;
        height: 180px;
    }
    
    .rcgm-lottie-container {
        width: 100px;
        height: 100px;
    }
    
    .rcgm-gifts-title {
        font-size: 2em;
    }
    
    .rcgm-gift-image {
        max-width: 140px;
        max-height: 140px;
    }
}

@media (max-width: 480px) {
    .rcgm-gifts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .rcgm-gift-box {
        width: 180px;
        height: 240px;
    }
    
    .rcgm-lottie-container {
        width: 80px;
        height: 80px;
    }
}

/* Confetti canvas */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* Additional Enhanced Styles - Add to frontend.css */

/* Gradient backgrounds for different gift types */
.rcgm-gift-front.premium {
    background: linear-gradient(45deg, #FFD700, #FFA500);
}

.rcgm-gift-front.food {
    background: linear-gradient(45deg, #FF6B6B, #FF8E8E);
}

.rcgm-gift-front.merchandise {
    background: linear-gradient(45deg, #4ECDC4, #44A08D);
}

/* Pulse animation for unopened gifts */
.rcgm-gift-item:not(.opened) .rcgm-gift-front {
    animation: gentlePulse 2s infinite;
}

@keyframes gentlePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Shimmer effect on gift names */
.rcgm-gift-name {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    background-size: 200% 100%;
    animation: shimmer 3s infinite;
    color:#242424;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Floating animation */
.rcgm-gift-item {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Success state for opened gifts */
.rcgm-gift-item.opened .rcgm-gift-back {
    /*border: 3px solid #4CAF50;*/
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

/* Loading States */
.rcgm-form-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.rcgm-form-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 10;
    border-radius: 10px;
}

.rcgm-form-loading::after {
    content: '🎁 Preparing your gifts...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 11;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px 30px;
    border-radius: 10px;
    font-weight: bold;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
}

/* Debug console styles */
#rcgm-debug-console {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: #333;
    color: #0f0;
    padding: 10px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 12px;
    z-index: 99999;
    max-width: 400px;
    max-height: 200px;
    overflow-y: auto;
    display: none; /* Hide by default, show with JS if needed */
}

/* Ensure Lottie player loads properly */
lottie-player {
    display: block;
    margin: 0 auto;
}

/* Fallback if Lottie doesn't load */
.rcgm-lottie-container.fallback::before {
    content: '🎁';
    font-size: 60px;
    display: block;
    text-align: center;
}

/* Error states */
.rcgm-error {
    background: #ff6b6b;
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin: 20px 0;
}

.rcgm-error h3 {
    margin: 0 0 10px 0;
}

/* Make sure form transitions are smooth */
.elementor-widget-form {
    transition: all 0.5s ease-in-out;
}

/* Hide Elementor's default success message */
.elementor-message.elementor-message-success {
    display: none !important;
}
/* Loading States */
.rcgm-form-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.rcgm-form-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 10;
    border-radius: 10px;
}

.rcgm-form-loading::after {
    content: '🎁 Preparing your gifts...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 11;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px 30px;
    border-radius: 10px;
    font-weight: bold;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
}

/* Hide Elementor's default success message */
.elementor-message.elementor-message-success {
    display: none !important;
}

/* Smooth transitions for header and form visibility */
#header1, #header2, #form-container, .canes-gift-section {
    transition: all 0.5s ease-in-out;
}

/* Ensure the gift section is properly styled when shown */
.canes-gift-section {
    /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    /*border-radius: 20px;*/
    margin: 20px 0;
    /*box-shadow: 0 20px 40px rgba(0,0,0,0.1);*/
    padding: 30px 20px;
    text-align:center;
}

/* Make sure the container takes full width */
#canes-gift-container {
    width: 100%;
}

/* Redemption Popup Styles */
.rcgm-redemption-overlay {
    backdrop-filter: blur(5px);
}

.rcgm-redemption-modal {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.rcgm-redeem-button {
    transition: all 0.3s ease;
}

.rcgm-redeem-button:hover {
    background-color: #b51524 !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(215, 28, 46, 0.3);
}

.rcgm-redemption-gift-row {
    transition: transform 0.2s ease;
}

.rcgm-redemption-gift-row:hover {
    transform: translateX(5px);
}

/* Close button hover effect */
.rcgm-redemption-modal button:first-child:hover {
    color: #333;
    background: none;
}

/* Staff code input focus */
.rcgm-redemption-modal input:focus {
    outline: none;
    border-color: #D71C2E !important;
    box-shadow: 0 0 5px rgba(215, 28, 46, 0.3);
}

/* Redemption Success Styles */
.rcgm-redemption-success {
    animation: successAppear 0.8s ease-out;
}

@keyframes successAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.rcgm-home-button {
    transition: all 0.3s ease;
}

.rcgm-home-button:hover {
    background-color: #b51524 !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(215, 28, 46, 0.3);
}

.rcgm-success-close:hover {
    color: #333 !important;
    background: none !important;
}

/* Ensure the modal has proper z-index for confetti */
.rcgm-redemption-modal {
    z-index: 10002;
    position: relative;
}

.rcgm-redemption-overlay {
    z-index: 10000;
}

/* Make overlay non-clickable */
.rcgm-redemption-overlay {
    pointer-events: auto; /* Ensure overlay receives events */
}

/* But don't close when clicking overlay */
.rcgm-redemption-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1; /* Place behind the modal */
}

/* Mobile-first approach for RCGM gift boxes */
.rcgm-gifts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 15px;
    max-width: 100%;
    margin: 0 auto;
}

.rcgm-gift-item {
    /*background: white;*/
    /*border-radius: 12px;*/
    /*padding: 15px;*/
    text-align: center;
    /*box-shadow: 0 4px 12px rgba(0,0,0,0.1);*/
    /*border: 2px solid #e0e0e0;*/
    /*transition: transform 0.3s ease, box-shadow 0.3s ease;*/
}

.rcgm-gift-item:hover {
    transform: translateY(-5px);
    /*box-shadow: 0 8px 20px rgba(0,0,0,0.15);*/
}

.rcgm-gift-box img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 10px;
}

.rcgm-gift-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    margin-top: 8px;
    line-height: 1.3;
}

/* Tablet */
@media (min-width: 768px) {
    .rcgm-gifts-grid {
        /*grid-template-columns: repeat(3, 1fr);*/
        gap: 20px;
        padding: 25px;
        grid-auto-column:22%;
        width:200px;
        justify-content: center;
        grid-auto-flow:column;
    }
    
    .rcgm-gift-item {
        /*padding: 20px;*/
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .rcgm-gifts-grid {
        /*grid-template-columns: repeat(4, 1fr);*/
        gap: 20px;
        grid-auto-column:22%;
        width:200px;
        justify-content: center;
        grid-auto-flow:column;
    }
}

/* Very small mobile devices */
@media (max-width: 480px) {
    .rcgm-gifts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px;
    }
    
    .rcgm-gift-item {
        /*padding: 12px 8px;*/
    }
    
    .rcgm-gift-name {
        font-size: 12px;
    }
}

/* Canes Swag Items - No Image, Centered Text */
.rcgm-gift-back.canes-swag-back {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    background: #f8f9fa !important;
    border: 2px dashed #dee2e6 !important;
}

.canes-swag-text {
    font-size: 1.2em !important;
    font-weight: bold !important;
    color: #333 !important;
    text-align: center !important;
    width: 100% !important;
    padding: 20px !important;
}

/* Ensure no image is shown for Canes Swag */
.rcgm-gift-back.canes-swag-back .rcgm-gift-image {
    display: none !important;
}

.rcgm-gift-back.canes-swag-back .rcgm-gift-name {
    display: none !important;
}

/* For RTL languages (Arabic) */
.rtl .canes-swag-text {
    text-align: center !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .canes-swag-text {
        font-size: 1em !important;
        padding: 15px !important;
    }
}