/**
 * EEZYCLOUD Composite Configurator Styles
 * Handles WooCommerce Composite Products + Product Add-Ons
 */

/* Button Container */
.eezycloud-button-container {
    text-align: center;
    margin: 2rem 0;
}

/* Build Button - Default styling (override in your theme) */
.eezycloud-build-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.eezycloud-build-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.eezycloud-build-button:active {
    transform: translateY(0);
}

/* Lightbox Container */
.eezycloud-lightbox-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
}

/* Overlay */
.eezycloud-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

/* Lightbox */
.eezycloud-lightbox {
    position: relative;
    width: 95%;
    max-width: 1400px;
    max-height: 90vh;
    margin: 2.5vh auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Close Button */
.eezycloud-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eezycloud-close-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: rotate(90deg);
}

/* Configurator Content - Scrollable */
.eezycloud-configurator-content {
    flex: 1;
    overflow-y: auto;
    padding: 3rem 2rem 2rem;
}

/* Form Container */
#eezycloud-form-container {
    max-width: 100%;
}

/* Ensure WooCommerce form displays properly */
#eezycloud-form-container .composite_form {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Component sections spacing */
#eezycloud-form-container .component {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e5e5e5;
}

#eezycloud-form-container .component:last-child {
    border-bottom: none;
}

/* Add-ons styling - ensure they're visible and properly spaced */
#eezycloud-form-container .wc-pao-addon-container,
#eezycloud-form-container .product-addon,
#eezycloud-form-container .addon-wrap {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 6px;
}

#eezycloud-form-container .wc-pao-addon-name,
#eezycloud-form-container .addon-name,
#eezycloud-form-container .addon-wrap label.addon-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
    color: #333;
}

/* Global add-ons section */
#eezycloud-form-container .product-addons-total {
    margin-top: 2rem;
    padding: 1rem;
    background: #f0f8ff;
    border-radius: 6px;
    border: 1px solid #d1e7ff;
}

/* Text fields (License Number, Product Code, etc) */
#eezycloud-form-container input[type="text"],
#eezycloud-form-container input[type="number"],
#eezycloud-form-container input[type="email"],
#eezycloud-form-container textarea {
    width: 100%;
    max-width: 500px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    margin-top: 0.25rem;
}

#eezycloud-form-container textarea {
    min-height: 100px;
    resize: vertical;
}

/* Checkboxes and Radio buttons (Add to Workspace, etc) */
#eezycloud-form-container input[type="checkbox"],
#eezycloud-form-container input[type="radio"] {
    margin-right: 0.5rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
    vertical-align: middle;
}

#eezycloud-form-container .wc-pao-addon-field,
#eezycloud-form-container .addon-field,
#eezycloud-form-container .addon-wrap-option {
    display: flex;
    align-items: center;
    margin: 0.75rem 0;
    padding: 0.5rem;
    transition: background 0.2s ease;
}

#eezycloud-form-container .addon-wrap-option:hover {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 4px;
}

#eezycloud-form-container label {
    cursor: pointer;
    margin-bottom: 0;
    line-height: 1.5;
}

/* Select dropdowns */
#eezycloud-form-container select {
    width: 100%;
    max-width: 500px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background: #fff;
    cursor: pointer;
}

/* Price display */
#eezycloud-form-container .component_option_price,
#eezycloud-form-container .addon-price,
#eezycloud-form-container .price-tag {
    color: #666;
    font-weight: 500;
    margin-left: 0.5rem;
}

/* Required field indicator */
#eezycloud-form-container .required {
    color: #e74c3c;
    margin-left: 0.25rem;
}

/* Quantity inputs */
#eezycloud-form-container .quantity input {
    width: 80px;
    padding: 0.5rem;
    text-align: center;
}

/* Add to cart button */
#eezycloud-form-container .single_add_to_cart_button {
    width: 100%;
    max-width: 400px;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 2rem;
    cursor: pointer;
}

/* Product titles */
#eezycloud-form-container .component_title,
#eezycloud-form-container .product_title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #222;
}

/* Descriptions */
#eezycloud-form-container .component_description,
#eezycloud-form-container .addon-description {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Product-specific add-ons sections */
#eezycloud-form-container .product-addon-quickbooks,
#eezycloud-form-container .product-addon-specific {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid #e5e5e5;
}

/* Validation errors */
#eezycloud-form-container .woocommerce-error,
#eezycloud-form-container .error {
    background: #fee;
    border-left: 4px solid #e74c3c;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
}

/* Success messages */
#eezycloud-form-container .woocommerce-message {
    background: #efe;
    border-left: 4px solid #27ae60;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 4px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .eezycloud-lightbox {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }
    
    .eezycloud-configurator-content {
        padding: 4rem 1.5rem 2rem;
    }
    
    .eezycloud-close-btn {
        top: 0.5rem;
        right: 0.5rem;
    }
    
    #eezycloud-form-container input[type="text"],
    #eezycloud-form-container input[type="number"],
    #eezycloud-form-container input[type="email"],
    #eezycloud-form-container textarea,
    #eezycloud-form-container select {
        max-width: 100%;
    }
}

/* Scrollbar styling */
.eezycloud-configurator-content::-webkit-scrollbar {
    width: 10px;
}

.eezycloud-configurator-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.eezycloud-configurator-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 5px;
}

.eezycloud-configurator-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}
