/**
 * Popup Styles - Minecraft Theme
 * Custom popup for add to cart functionality
 */

/* Popup Overlay */
.minecraft-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: none;
    backdrop-filter: blur(2px);
}

/* Popup Content Container */
.minecraft-popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: var(--card-bg);
    border: 3px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    min-width: 400px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Popup Enter Animation */
.minecraft-popup-content.popup-enter {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Close Button */
.minecraft-popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
    z-index: 1;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.minecraft-popup-close:hover {
    background: var(--overlay-light);
    color: var(--error-color);
}

/* Popup Header */
.minecraft-popup-header {
    background: var(--gradient-success);
    color: white;
    padding: 20px;
    text-align: center;
    border-radius: 5px 5px 0 0;
    position: relative;
}

.minecraft-popup-header .success-icon-css {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 auto 10px auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.minecraft-popup-header .success-icon-css::after {
    content: '✓';
    color: white;
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
}

.minecraft-popup-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Popup Body */
.minecraft-popup-body {
    padding: 20px;
    color: var(--white);
}

.product-info {
    margin-bottom: 20px;
    text-align: center;
}

.product-info .product-name {
    font-size: 20px;
    font-weight: bold;
    color: var(--gold-color);
    margin: 0 0 10px 0;
    text-shadow: 1px 1px 2px var(--shadow-black-light);
}

.product-info .success-message {
    font-size: 16px;
    margin: 0;
    color: var(--text-secondary);
}

.cart-summary {
    background: var(--shadow-black);
    padding: 15px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.cart-summary p {
    margin: 5px 0;
    font-size: 17px;
    color: var(--text-secondary);
}

.cart-summary .cart-total {
    font-weight: bold;
    color: var(--gold-color);
    font-size: 17px;
}

/* Popup Footer */
.minecraft-popup-footer {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0 0 5px 5px;
}

/* Timer Container */
.popup-timer-container {
    margin-bottom: 15px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.popup-timer-container.active {
    opacity: 1;
}

.popup-timer-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.popup-timer-progress {
    height: 100%;
    background: var(--gradient-bg);
    border-radius: 2px;
    transition: width 1s linear;
    box-shadow: 0 0 10px var(--shadow-purple);
    width: 100%;
}

.popup-timer-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
}

.timer-countdown {
    color: var(--primary-purple);
    font-weight: bold;
}

/* Popup Buttons Container */
.popup-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Popup Buttons */
.btn-continue-shopping,
.btn-view-cart {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
}

.btn-continue-shopping {
    background: var(--gray-light);
    color: white;
}

.btn-continue-shopping:hover {
    background: var(--gray-dark);
    transform: translateY(-1px);
}

.btn-view-cart {
    background: var(--gradient-success);
    color: white;
}

.btn-view-cart:hover {
    background: var(--gradient-success-hover);
    transform: translateY(-1px);
    text-decoration: none;
    color: white;
}

/* Force purple glow button styling - Ultra specific selectors */
li.product button.custom-add-to-cart-btn,
.woocommerce ul.products li.product button.custom-add-to-cart-btn,
.woocommerce-page ul.products li.product button.custom-add-to-cart-btn,
body.woocommerce li.product button.custom-add-to-cart-btn,
body.woocommerce-page li.product button.custom-add-to-cart-btn {
    background: var(--gradient-bg) !important;
    color: white !important;
    border: none !important;
    padding: 12px 20px !important;
    border-radius: 25px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 14px !important;
    box-shadow: 0 4px 15px rgba(162, 89, 255, 0.3) !important;
    position: relative !important;
    overflow: hidden !important;
    text-decoration: none !important;
    width: 100% !important;
    margin-top: 10px !important;
}

li.product button.custom-add-to-cart-btn:hover,
.woocommerce ul.products li.product button.custom-add-to-cart-btn:hover,
.woocommerce-page ul.products li.product button.custom-add-to-cart-btn:hover,
body.woocommerce li.product button.custom-add-to-cart-btn:hover,
body.woocommerce-page li.product button.custom-add-to-cart-btn:hover {
    background: linear-gradient(135deg, var(--secondary-purple), var(--dark-purple)) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 25px var(--shadow-purple) !important;
    color: white !important;
    text-decoration: none !important;
}

/* Shimmer effect for ultra-specific selectors */
li.product button.custom-add-to-cart-btn::before,
.woocommerce ul.products li.product button.custom-add-to-cart-btn::before,
.woocommerce-page ul.products li.product button.custom-add-to-cart-btn::before,
body.woocommerce li.product button.custom-add-to-cart-btn::before,
body.woocommerce-page li.product button.custom-add-to-cart-btn::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent) !important;
    transition: left 0.5s !important;
}

li.product button.custom-add-to-cart-btn:hover::before,
.woocommerce ul.products li.product button.custom-add-to-cart-btn:hover::before,
.woocommerce-page ul.products li.product button.custom-add-to-cart-btn:hover::before,
body.woocommerce li.product button.custom-add-to-cart-btn:hover::before,
body.woocommerce-page li.product button.custom-add-to-cart-btn:hover::before {
    left: 100% !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .minecraft-popup-content {
        min-width: 320px;
        width: 95%;
        margin: 20px;
    }
    
    .minecraft-popup-header h3 {
        font-size: 20px;
    }
    
    .minecraft-popup-header .success-icon-css {
        width: 36px;
        height: 36px;
    }
    
    .minecraft-popup-header .success-icon-css::after {
        font-size: 18px;
    }
    
    .popup-buttons {
        flex-direction: column;
    }
    
    .btn-continue-shopping,
    .btn-view-cart {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .minecraft-popup-content {
        min-width: 280px;
    }
    
    .minecraft-popup-body {
        padding: 15px;
    }
    
    .minecraft-popup-header,
    .minecraft-popup-footer {
        padding: 15px;
    }
}

/* Loading Animation */
.custom-add-to-cart-btn .bi-hourglass-split {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hide default "View Cart" link */
.added_to_cart.wc-forward {
    display: none !important;
}

/* Override WooCommerce default styles */
.woocommerce ul.products li.product .button.added {
    display: none !important;
}

.woocommerce ul.products li.product .added_to_cart {
    display: none !important;
}

/* FINAL OVERRIDE - Purple Glowy Button (Maximum Specificity) */
html body.woocommerce ul.products li.product button.custom-add-to-cart-btn,
html body.woocommerce-page ul.products li.product button.custom-add-to-cart-btn,
html body li.product button.custom-add-to-cart-btn.button {
    background: var(--gradient-bg) !important;
    color: white !important;
    border: none !important;
    padding: 12px 20px !important;
    border-radius: 25px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    font-size: 14px !important;
    box-shadow: 0 4px 15px rgba(162, 89, 255, 0.3) !important;
    position: relative !important;
    overflow: hidden !important;
    text-decoration: none !important;
    width: 100% !important;
    margin-top: 10px !important;
    min-height: 44px !important;
}

html body.woocommerce ul.products li.product button.custom-add-to-cart-btn:hover,
html body.woocommerce-page ul.products li.product button.custom-add-to-cart-btn:hover,
html body li.product button.custom-add-to-cart-btn.button:hover {
    background: linear-gradient(135deg, #8b47e8, #6c2bd9) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 25px rgba(162, 89, 255, 0.5) !important;
    color: white !important;
    text-decoration: none !important;
}

html body.woocommerce ul.products li.product button.custom-add-to-cart-btn:active,
html body.woocommerce-page ul.products li.product button.custom-add-to-cart-btn:active,
html body li.product button.custom-add-to-cart-btn.button:active {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 15px rgba(162, 89, 255, 0.4) !important;
}

/* Shimmer effect with maximum specificity */
html body.woocommerce ul.products li.product button.custom-add-to-cart-btn::before,
html body.woocommerce-page ul.products li.product button.custom-add-to-cart-btn::before,
html body li.product button.custom-add-to-cart-btn.button::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: -100% !important;
    width: 100% !important;
    height: 100% !important;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent) !important;
    transition: left 0.5s !important;
    z-index: 1 !important;
}

html body.woocommerce ul.products li.product button.custom-add-to-cart-btn:hover::before,
html body.woocommerce-page ul.products li.product button.custom-add-to-cart-btn:hover::before,
html body li.product button.custom-add-to-cart-btn.button:hover::before {
    left: 100% !important;
}

/* Ensure text and icons are above shimmer effect */
html body.woocommerce ul.products li.product button.custom-add-to-cart-btn > *,
html body.woocommerce-page ul.products li.product button.custom-add-to-cart-btn > *,
html body li.product button.custom-add-to-cart-btn.button > * {
    position: relative !important;
    z-index: 2 !important;
}

/* Copy Notification Popup Styles */
.copy-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--gradient-success);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    font-weight: 600;
    font-size: 14px;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
}

.copy-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.copy-notification::before {
    content: '📋';
    margin-right: 8px;
    font-size: 16px;
}

/* Mobile responsive for copy notification */
@media (max-width: 768px) {
    .copy-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        transform: translateY(-100%);
        text-align: center;
    }
    
    .copy-notification.show {
        transform: translateY(0);
    }
}
