/* Product Design Customizer Styles */

.product-customizer-fields {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.customizer-field {
    margin-bottom: 20px;
}

.customizer-field:last-child {
    margin-bottom: 0;
}

.customizer-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.customizer-field label .required {
    color: #e74c3c;
    margin-left: 4px;
}

.customizer-field input[type="file"] {
    display: block;
    width: 100%;
    padding: 10px;
    border: 2px dashed #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.customizer-field input[type="file"]:hover {
    border-color: #999;
}

.customizer-field input[type="file"]:focus {
    outline: none;
    border-color: #0073aa;
}

.customizer-field textarea {
    display: block;
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.customizer-field textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.customizer-field .description {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.customizer-field .char-count {
    text-align: right;
    margin-top: 5px;
    font-size: 12px;
    color: #999;
}

.customizer-field .char-count #char-count {
    font-weight: 600;
    color: #333;
}

.image-preview {
    margin-top: 15px;
    display: none;
}

.image-preview.active {
    display: block;
}

.image-preview img {
    max-width: 200px;
    height: auto;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.image-preview .remove-image {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 12px;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s ease;
}

.image-preview .remove-image:hover {
    background: #c0392b;
}

/* Cart and Order Display */
.woocommerce-cart-form__cart-item .custom-design-image img,
.woocommerce-checkout-review-order-table .custom-design-image img {
    max-width: 80px;
    height: auto;
    border-radius: 4px;
}

/* Admin Order Display */
.custom-design-image,
.custom-design-text {
    margin: 10px 0;
    padding: 10px;
    background: #f9f9f9;
    border-left: 3px solid #0073aa;
}

.custom-design-image strong,
.custom-design-text strong {
    display: block;
    margin-bottom: 8px;
    color: #0073aa;
}

.custom-design-text p {
    margin: 8px 0 0 0;
    padding: 8px;
    background: #fff;
    border-radius: 4px;
    white-space: pre-wrap;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .product-customizer-fields {
        padding: 15px;
    }
    
    .image-preview img {
        max-width: 150px;
    }
}

/* Loading State */
.customizer-field.loading {
    opacity: 0.6;
    pointer-events: none;
}

.customizer-field.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error Messages */
.customizer-error {
    padding: 10px;
    margin-top: 10px;
    background: #ffebee;
    color: #c62828;
    border-left: 3px solid #c62828;
    border-radius: 4px;
    font-size: 13px;
}

/* Success Messages */
.customizer-success {
    padding: 10px;
    margin-top: 10px;
    background: #e8f5e9;
    color: #2e7d32;
    border-left: 3px solid #2e7d32;
    border-radius: 4px;
    font-size: 13px;
}
