/**
 * WooCommerce Freebie Checkbox Plugin Styles
 */

/* Checkbox wrapper */
.wcfc-checkbox-wrapper {
    margin: 12px 0;
    padding: 12px;
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.wcfc-checkbox-wrapper:hover {
    border-color: #c1c1c1;
    background: #f5f5f5;
}

/* Checkbox label */
.wcfc-checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
    gap: 8px;
}

/* Checkbox input */
.wcfc-checkbox {
    margin: 0;
    margin-top: 2px;
    width: 18px;
    height: 18px;
    accent-color: #0073aa;
    flex-shrink: 0;
}

/* Checkbox text content */
.wcfc-checkbox-text {
    flex-grow: 1;
    font-weight: 500;
    color: #333;
}

/* Description text */
.wcfc-description {
    display: block;
    margin-top: 4px;
    color: #666;
    font-style: italic;
    font-size: 13px;
    line-height: 1.3;
}

/* Price display */
.wcfc-price {
    color: #a3a3a3;
    font-weight: 600;
    margin-left: 8px;
    white-space: nowrap;
}

/* Loading indicator */
.wcfc-loading {
    display: none;
    padding: 8px 0;
    color: #666;
    font-style: italic;
    font-size: 13px;
}

.wcfc-loading span:before {
    content: "⟳ ";
    display: inline-block;
    animation: wcfc-spin 1s linear infinite;
}

@keyframes wcfc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Checkbox states */
.wcfc-checkbox-wrapper.wcfc-loading-state {
    opacity: 0.7;
    pointer-events: none;
}

.wcfc-checkbox-wrapper.wcfc-loading-state .wcfc-loading {
    display: block;
}

/* Error messages */
.wcfc-error {
    color: #d63638;
    background: #fff5f5;
    border: 1px solid #f1c4c4;
    padding: 8px 12px;
    border-radius: 4px;
    margin: 8px 0;
    font-size: 14px;
}

/* Success messages */
.wcfc-success {
    color: #00a32a;
    background: #f0f6fc;
    border: 1px solid #c3e6cb;
    padding: 8px 12px;
    border-radius: 4px;
    margin: 8px 0;
    font-size: 14px;
}

/* Message animations */
.wcfc-message {
    animation: wcfc-fadeIn 0.3s ease-in;
}

@keyframes wcfc-fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive design */
@media (max-width: 768px) {
    .wcfc-checkbox-wrapper {
        margin: 10px 0;
        padding: 10px;
    }
    
    .wcfc-checkbox-label {
        font-size: 13px;
    }
    
    .wcfc-price {
        display: block;
        margin-left: 0;
        margin-top: 4px;
    }
}

/* Integration with WooCommerce checkout */
#order_review .wcfc-checkbox-wrapper {
    background: transparent;
    border: none;
    padding: 8px 0;
}

.woocommerce-checkout .wcfc-checkbox-wrapper {
    border-color: #ddd;
}

.woocommerce-checkout .wcfc-checkbox-wrapper:hover {
    border-color: #bbb;
}

/* Accessibility improvements */
.wcfc-checkbox:focus {
    outline: 2px solid #005a87;
    outline-offset: 2px;
}

.wcfc-checkbox-label:hover .wcfc-checkbox-text {
    color: #0073aa;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .wcfc-checkbox-wrapper {
        border-color: #000;
    }
    
    .wcfc-checkbox-text {
        color: #000;
    }
    
    .wcfc-price {
        color: #000;
        text-decoration: underline;
    }
}

/* Visual Enhancer Styles */
#wcfc-visual-enhancer {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    z-index: 9999;
    width: 60px !important;
    height: 60px !important;
}

.wcfc-package-icon {
    width: 60px !important;
    height: 60px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4) !important;
    transition: all 0.3s ease !important;
    animation: wcfc-pulse 2s infinite !important;
    color: white !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Special styling for GIF icons - transparent background */
.wcfc-package-icon.wcfc-gif-icon {
    background: transparent !important;
    box-shadow: none !important;
    animation: none !important;
    border-radius: 8px !important;
    overflow: visible !important;
}

.wcfc-package-icon.wcfc-gif-icon:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
    animation: none !important;
}

/* Special styling for GIF icons */
.wcfc-package-icon img {
    width: 60px !important;
    height: 60px !important;
    border-radius: 8px !important;
    object-fit: cover !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
}

.wcfc-package-icon:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6) !important;
    animation-play-state: paused !important;
}

@keyframes wcfc-pulse {
    0% {
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 4px 30px rgba(102, 126, 234, 0.8);
        transform: scale(1.05);
    }
    100% {
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    }
}

/* Popup Overlay - Completely separate from trigger */
.wcfc-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.wcfc-popup-overlay.wcfc-popup-active {
    opacity: 1;
    visibility: visible;
}

.wcfc-popup-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.8);
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.wcfc-popup-active .wcfc-popup-content {
    transform: scale(1);
}

.wcfc-popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    z-index: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.wcfc-popup-close:hover {
    background: #f0f0f0;
    color: #333;
}

.wcfc-popup-body {
    padding: 30px;
    text-align: center;
}

.wcfc-popup-image {
    margin-bottom: 20px;
}

.wcfc-popup-image img {
    max-width: 200px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.wcfc-popup-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.wcfc-popup-price {
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 15px;
}

.wcfc-popup-text {
    font-size: 16px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 25px;
}

.wcfc-popup-checkbox-wrapper {
    margin-top: 20px;
}

.wcfc-popup-checkbox-wrapper .wcfc-checkbox-wrapper {
    background: #f93d00;
    border: 2px solid #f93d00;
    border-radius: 8px;
    padding: 15px;
    margin: 0;
}

.wcfc-popup-checkbox-wrapper .wcfc-checkbox-label {
    font-size: 16px;
    font-weight: 500;
    justify-content: center;
}

.wcfc-popup-checkbox-wrapper .wcfc-checkbox {
    width: 20px;
    height: 20px;
    position: inherit;
}

.wcfc-popup-close {
    position: absolute !important;
    top: 15px !important;
    right: 20px !important;
    background: none !important;
    border: none !important;
    font-size: 28px !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    color: #999 !important;
    z-index: 100001 !important;
    width: 30px !important;
    height: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    transition: all 0.2s ease !important;
}

.wcfc-popup-close:hover {
    background: #f0f0f0 !important;
    color: #333 !important;
}

.wcfc-popup-body {
    padding: 30px !important;
    text-align: center !important;
}

.wcfc-popup-image {
    margin-bottom: 20px !important;
}

.wcfc-popup-image img {
    max-width: 200px !important;
    height: auto !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
    background: transparent !important;
}

.wcfc-popup-title {
    font-size: 24px !important;
    font-weight: 600 !important;
    color: #333 !important;
    margin: 0 0 10px 0 !important;
    line-height: 1.3 !important;
}

.wcfc-popup-price {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #f93d00 !important;
    margin-bottom: 15px !important;
}

.wcfc-popup-text {
    font-size: 16px !important;
    color: #666 !important;
    line-height: 1.5 !important;
    margin-bottom: 25px !important;
}

.wcfc-popup-checkbox-wrapper {
    margin-top: 20px !important;
}

.wcfc-popup-checkbox-wrapper .wcfc-checkbox-wrapper {
    background: #f8f9ff !important;
    border: 2px solid #f93d00 !important;
    border-radius: 8px !important;
    padding: 15px !important;
    margin: 0 !important;
}

.wcfc-popup-checkbox-wrapper .wcfc-checkbox-label {
    font-size: 16px !important;
    font-weight: 500 !important;
    justify-content: center !important;
}

.wcfc-popup-checkbox-wrapper .wcfc-checkbox {
    width: 20px !important;
    height: 20px !important;
    display: none !important;
}

/* Hide the actual checkbox in popup, keep only the label clickable */
.wcfc-popup-checkbox-wrapper .wcfc-checkbox-label {
    cursor: pointer !important;
    padding: 12px 20px !important;
    background: #f93d00 !important;
    color: white !important;
    border-radius: 6px !important;
    text-align: center !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    display: block !important;
    margin: 0 !important;
}

.wcfc-popup-checkbox-wrapper .wcfc-checkbox-label:hover {
    background: #000000 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3) !important;
}

.wcfc-popup-checkbox-wrapper .wcfc-checkbox-text {
    color: white !important;
    font-size: 16px !important;
}

/* Prevent body scroll when popup is open */
body.wcfc-popup-open {
    overflow: hidden !important;
}

/* Mobile responsive popup */
@media (max-width: 768px) {
    #wcfc-visual-enhancer {
        right: 15px !important;
    }
    
    .wcfc-package-icon {
        width: 50px;
        height: 50px;
    }
    
    .wcfc-popup-content {
        width: 95%;
        margin: 20px;
    }
    
    .wcfc-popup-body {
        padding: 20px;
    }
    
    .wcfc-popup-title {
        font-size: 20px;
    }
    
    .wcfc-popup-image img {
        max-width: 150px;
    }
    #wcfc-visual-enhancer {
        right: 15px;
    }
    
    .wcfc-package-icon {
        width: 50px !important;
        height: 50px !important;
    }
    
    .wcfc-popup-content {
        width: 95% !important;
    }
    
    .wcfc-popup-body {
        padding: 20px !important;
    }
    
    .wcfc-popup-title {
        font-size: 20px !important;
    }
    
    .wcfc-popup-image img {
        max-width: 150px !important;
    }
}
/* Popup Overlay - Attached directly to body, not trigger */
    pointer-events: none !important;
    pointer-events: auto !important;
	
/* CONFETTI STYLES */
#wcfc-confetti {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999999 !important;
    overflow: hidden;
    display: block !important;
}

.wcfc-confetti-piece {
    position: absolute;

    border-radius: 3px;
    opacity: 0.9;
    animation: wcfc-confetti-fall linear forwards;
}

@keyframes wcfc-confetti-fall {
    0% {
        transform: translateY(-50px) rotate(0deg) scale(1);
        opacity: 1;
    }
    50% {
        opacity: 0.9;
    }
    100% {
        transform: translateY(calc(100vh + 50px)) rotate(720deg) scale(0.5);
        opacity: 0;
    }
}

/* Confetti intensity variations */
.wcfc-confetti-light {
    z-index: 999999 !important;
}

.wcfc-confetti-light .wcfc-confetti-piece {
    animation-duration: 2.5s !important;
    width: 8px !important;
    height: 8px !important;
}

.wcfc-confetti-medium {
    z-index: 999999 !important;
}

.wcfc-confetti-medium .wcfc-confetti-piece {
    animation-duration: 3.5s !important;
    width: 12px !important;
    height: 12px !important;
}

.wcfc-confetti-intense {
    z-index: 999999 !important;
}

.wcfc-confetti-intense .wcfc-confetti-piece {
    animation-duration: 4.5s !important;
    width: 16px !important;
    height: 16px !important;
}

/* Additional confetti piece variations */
.wcfc-confetti-piece:nth-child(odd) {
    animation-delay: 0s !important;
    border-radius: 50% !important;
}

.wcfc-confetti-piece:nth-child(even) {
    animation-delay: 0.1s !important;
    border-radius: 2px !important;
}

.wcfc-confetti-piece:nth-child(3n) {
    animation-delay: 0.2s !important;
    transform: rotate(45deg) !important;
}

.wcfc-confetti-piece:nth-child(4n) {
    animation-delay: 0.3s !important;
    border-radius: 1px !important;
}

.wcfc-confetti-piece:nth-child(5n) {
    animation-delay: 0.4s !important;
    border-radius: 50% !important;
}

/* Print Styles */
@media print {
    #wcfc-visual-enhancer,
    #wcfc-enhancer-popup,
    .wcfc-page-message,
    #wcfc-confetti {
        display: none !important;
    }
}

/* Page Messages */
.wcfc-page-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    z-index: 10001;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    max-width: 300px;
}

.wcfc-page-message-show {
    transform: translateX(0);
}

.wcfc-page-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wcfc-page-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}