/**
 * Ezycreate Product Page Styles
 * Styling for product variations and customize button
 * 
 * @package Ezycreate_For_WooCommerce
 */

/* ==========================================================================
   Customize Button Styles
   ========================================================================== */

/**
 * Main customize button
 */
.ezy_customise_button {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    background-color: #0073aa;
    color: #ffffff !important;
}

.ezy_customise_button:hover {
    background-color: #005177;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.3);
}

.ezy_customise_button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.2);
}

.ezy_customise_button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #cccccc;
}

.ezy_customise_button:disabled:hover {
    background-color: #cccccc;
    transform: none;
    box-shadow: none;
}

/* ==========================================================================
   Hide Default WooCommerce Elements for Ezycreate Products
   ========================================================================== */

/**
 * Hide standard add to cart button for Ezycreate products
 * The customize button replaces this
 */
.single_add_to_cart_button {
    display: none !important;
}

/**
 * Hide quantity selector for Ezycreate products
 * Quantity will be handled in the designer
 */
.quantity {
    display: none !important;
}

/**
 * Hide SKU display on product page
 */
.sku_wrapper {
    display: none !important;
}

/* ==========================================================================
   Variation Add to Cart Area
   ========================================================================== */

/**
 * Wrapper for variation add to cart section
 */
.woocommerce-variation-add-to-cart {
    margin-top: 20px;
}

.variations_button {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

/**
 * Loading indicator for button
 */
.ezy_customise_button.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.ezy_customise_button.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: ezy-spinner 0.6s linear infinite;
}

@keyframes ezy-spinner {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

/**
 * Mobile devices
 */
@media screen and (max-width: 768px) {
    .ezy_customise_button {
        width: 100%;
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .woocommerce-variation-add-to-cart {
        margin-top: 15px;
    }
}

/**
 * Small mobile devices
 */
@media screen and (max-width: 480px) {
    .ezy_customise_button {
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* ==========================================================================
   Variation Selection Messages
   ========================================================================== */

/**
 * Style for variation selection message
 */
.woocommerce-variation-description {
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f7f7f7;
    border-left: 3px solid #0073aa;
    font-size: 14px;
}

/**
 * Out of stock message
 */
.woocommerce-variation-availability {
    margin-bottom: 15px;
}

.out-of-stock {
    color: #e2401c;
    font-weight: 600;
}

/* ==========================================================================
   Variation Attributes Display
   ========================================================================== */

/**
 * Selected variation details
 */
.woocommerce-variation {
    margin-bottom: 20px;
}

.woocommerce-variation-price {
    margin-bottom: 15px;
}

.woocommerce-variation-price .price {
    font-size: 24px;
    font-weight: 700;
    color: #0073aa;
}

/* ==========================================================================
   Custom Ezycreate Product Badges
   ========================================================================== */

/**
 * Customizable product badge
 */
.ezycreate-customizable-badge {
    display: inline-block;
    padding: 5px 12px;
    margin-bottom: 10px;
    background-color: #0073aa;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   Variation Swatches Support (if using color/image variations)
   ========================================================================== */

/**
 * Color swatches
 */
.variation-selector-color {
    display: inline-block;
    width: 36px;
    height: 36px;
    border: 2px solid #ddd;
    border-radius: 50%;
    margin-right: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.variation-selector-color:hover {
    border-color: #0073aa;
    transform: scale(1.1);
}

.variation-selector-color.selected {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

/**
 * Size buttons
 */
.variation-selector-size {
    display: inline-block;
    padding: 8px 16px;
    margin-right: 8px;
    margin-bottom: 8px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.variation-selector-size:hover {
    border-color: #0073aa;
    color: #0073aa;
}

.variation-selector-size.selected {
    border-color: #0073aa;
    background-color: #0073aa;
    color: #ffffff;
}

/* ==========================================================================
   Error Messages
   ========================================================================== */

/**
 * Variation selection error
 */
.woocommerce-variation-error {
    padding: 12px;
    margin-bottom: 15px;
    background-color: #f8dda7;
    border-left: 3px solid #ffb900;
    color: #000000;
    font-size: 14px;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

/**
 * Focus styles for keyboard navigation
 */
.ezy_customise_button:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.variation-selector-color:focus,
.variation-selector-size:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .ezy_customise_button,
    .variations_button {
        display: none !important;
    }
}

/* ==========================================================================
   Theme Compatibility Overrides
   ========================================================================== */

/**
 * Ensure button styles aren't overridden by theme
 */
.woocommerce div.product form.cart .ezy_customise_button,
.woocommerce #content div.product form.cart .ezy_customise_button,
.woocommerce-page div.product form.cart .ezy_customise_button,
.woocommerce-page #content div.product form.cart .ezy_customise_button {
    background-color: #0073aa !important;
    color: #ffffff !important;
    border: none !important;
}

.woocommerce div.product form.cart .ezy_customise_button:hover,
.woocommerce #content div.product form.cart .ezy_customise_button:hover,
.woocommerce-page div.product form.cart .ezy_customise_button:hover,
.woocommerce-page #content div.product form.cart .ezy_customise_button:hover {
    background-color: #005177 !important;
    color: #ffffff !important;
}

/* ==========================================================================
   RTL Support
   ========================================================================== */

/**
 * Right-to-left language support
 */
[dir="rtl"] .variation-selector-color,
[dir="rtl"] .variation-selector-size {
    margin-right: 0;
    margin-left: 8px;
}

[dir="rtl"] .woocommerce-variation-description,
[dir="rtl"] .woocommerce-variation-error {
    border-left: none;
    border-right: 3px solid #0073aa;
}

/* ==========================================================================
   Dark Mode Support (Optional)
   ========================================================================== */

/**
 * Dark mode styles (if theme supports prefers-color-scheme)
 */
@media (prefers-color-scheme: dark) {
    .woocommerce-variation-description {
        background-color: #2d2d2d;
        color: #ffffff;
    }
    
    .variation-selector-size {
        border-color: #555555;
        color: #ffffff;
    }
    
    .variation-selector-size:hover {
        border-color: #0073aa;
    }
}

/* ==========================================================================
   High Contrast Mode Support
   ========================================================================== */

@media (prefers-contrast: high) {
    .ezy_customise_button {
        border: 2px solid currentColor;
    }
    
    .variation-selector-color,
    .variation-selector-size {
        border-width: 3px;
    }
}

/* ==========================================================================
   Animation Preferences
   ========================================================================== */

/**
 * Respect user's motion preferences
 */
@media (prefers-reduced-motion: reduce) {
    .ezy_customise_button,
    .variation-selector-color,
    .variation-selector-size {
        transition: none;
    }
    
    .ezy_customise_button:hover {
        transform: none;
    }
    
    @keyframes ezy-spinner {
        to {
            transform: none;
        }
    }
}

/* ==========================================================================
    Get Started
   ========================================================================== */

/**
 * 
 */

        
        .ezycreate-dashboard {
            max-width: 1200px;
        }
        
        /* Hero Section */
        .ezycreate-hero {
            background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
            color: white;
            padding: 40px 50px;
            border-radius: 8px;
            margin: 20px 0 30px 0;
            position: relative;
            overflow: hidden;
        }
        
        .ezycreate-hero::before {
            content: '';
            position: absolute;
            top: -50%;
            right: -10%;
            width: 500px;
            height: 500px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 50%;
            z-index: 0;
        }
        
        /* Logo at the top */
        .ezycreate-hero-header {
            position: relative;
            z-index: 1;
            margin-bottom: 30px;
            text-align: center;
        }
        
        /* Main content area - flexbox for heading and description side by side with image */
        .ezycreate-hero-content {
            position: relative;
            z-index: 1;
            display: flex;
            flex-direction: column;
            gap: 15px;
        }
        
        /* Logo Styles */
        .ezycreate-logo-container {
            display: inline-block;
        }
        
        .ezycreate-logo {
            max-width: 200px;
            height: auto;
            display: block;
            margin: 0 auto;
        }
        
        .ezycreate-logo-fallback {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            color: white;
        }
        
        .ezycreate-logo-fallback .dashicons {
            font-size: 42px;
            width: 42px;
            height: 42px;
        }
        
        .ezycreate-logo-fallback .logo-text {
            font-size: 28px;
            font-weight: 700;
            letter-spacing: 0.5px;
            text-transform: lowercase;
        }
        
        .ezycreate-hero h2 {
            color: white;
            font-size: 32px;
            margin: 0 0 10px 0;
            line-height: 1.3;
            text-align: center;
            font-weight: 600;
        }
        
        .ezycreate-hero-description {
            font-size: 16px;
            line-height: 1.6;
            opacity: 0.95;
            text-align: center;
            max-width: 900px;
            margin: 0 auto;
        }
        
        .ezycreate-hero-image {
            display: none; /* Hide the side image for cleaner centered layout */
        }
        
        /* Cards Grid */
        .ezycreate-cards {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 20px;
            margin: 30px 0;
        }
        
        .ezycreate-card {
            background: white;
            border: 1px solid #ddd;
            border-radius: 8px;
            padding: 25px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
            transition: transform 0.2s, box-shadow 0.2s;
        }
        
        .ezycreate-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        }
        
        .ezycreate-card.card-success {
            border-left: 4px solid #46b450;
        }
        
        .ezycreate-card.card-warning {
            border-left: 4px solid #ffb900;
        }
        
        .card-icon {
            font-size: 48px;
            color: #2271b1;
            margin-bottom: 15px;
        }
        
        .card-content h3 {
            margin: 0 0 10px 0;
            font-size: 18px;
            color: #1e1e1e;
        }
        
        .card-status {
            display: flex;
            align-items: center;
            gap: 8px;
            font-weight: 600;
            margin: 10px 0;
        }
        
        .card-status.success {
            color: #46b450;
        }
        
        .card-status.warning {
            color: #ffb900;
        }
        
        .card-number {
            font-size: 36px;
            font-weight: bold;
            color: #2271b1;
            margin: 10px 0;
        }
        
        .ezycreate-links {
            list-style: none;
            padding: 0;
            margin: 15px 0 0 0;
        }
        
        .ezycreate-links li {
            margin: 8px 0;
        }
        
        .ezycreate-links a {
            display: flex;
            align-items: center;
            gap: 8px;
            color: #2271b1;
            text-decoration: none;
        }
        
        .ezycreate-links a:hover {
            color: #135e96;
        }
        
        /* Quick Start Guide */
        .ezycreate-quick-start {
            background: white;
            border: 1px solid #ddd;
            border-radius: 8px;
            padding: 30px;
            margin: 30px 0;
        }
        
        .ezycreate-quick-start h2 {
            margin-top: 0;
            color: #1e1e1e;
        }
        
        .quick-start-steps {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin-top: 25px;
        }
        
        .quick-start-step {
            position: relative;
            padding: 20px;
            background: #f8f9fa;
            border-radius: 8px;
        }
        
        .step-number {
            width: 40px;
            height: 40px;
            background: #2271b1;
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            font-weight: bold;
            margin-bottom: 15px;
        }
        
        .step-content h3 {
            margin: 0 0 10px 0;
            font-size: 16px;
            color: #1e1e1e;
        }
        
        .step-content p {
            color: #646970;
            font-size: 14px;
            margin-bottom: 15px;
        }
        
        /* Features Section */
        .ezycreate-features {
            background: white;
            border: 1px solid #ddd;
            border-radius: 8px;
            padding: 30px;
            margin: 30px 0;
        }
        
        .ezycreate-features h2 {
            margin-top: 0;
            color: #1e1e1e;
        }
        
        .features-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 25px;
            margin-top: 25px;
        }
        
        .feature-item {
            text-align: center;
            padding: 20px;
        }
        
        .feature-item .dashicons {
            font-size: 48px;
            color: #2271b1;
            width: 48px;
            height: 48px;
        }
        
        .feature-item h3 {
            margin: 15px 0 10px 0;
            font-size: 16px;
            color: #1e1e1e;
        }
        
        .feature-item p {
            color: #646970;
            font-size: 14px;
            line-height: 1.6;
        }
        
        /* Responsive */
        @media (max-width: 782px) {
            .ezycreate-hero {
                padding: 30px 20px;
            }
            
            .ezycreate-hero h2 {
                font-size: 24px;
            }
            
            .ezycreate-hero-description {
                font-size: 14px;
            }
            
            .ezycreate-logo {
                max-width: 160px;
            }
            
            .ezycreate-cards,
            .quick-start-steps,
            .features-grid {
                grid-template-columns: 1fr;
            }
        }
        
/* ==========================================================================
   Ezycreate Customise Button — WooCommerce overrides
   ========================================================================== */

/**
 * Hide standard add-to-cart and quantity for Ezycreate products.
 * The Customise button replaces these elements.
 */
.single_add_to_cart_button,
.quantity {
    display: none !important;
}

.sku_wrapper {
    display: none !important;
}

/**
 * Disabled state for the Customise button while the session is loading.
 */
#ezy-customise-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}