/**
 * Estiene Image Customizer Styles - Single Canvas Version
 * One canvas displays currently selected image
 */

/* Wrapper for full width */
.estiene-image-customizer-wrapper {
    /*width: 100vw;*/
    position: relative;
    /*left: 50%;*/
    /*right: 50%;*/
    /*margin-left: -50vw;*/
    /*margin-right: -50vw;*/
    margin-top: 0;
    display: inline-block;
    width: 100%;
    margin-bottom: 0;
    padding: 0;
}

/* Main Customizer Container */
.estiene-image-customizer {
    margin: 40px auto;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    max-width: 1400px;
    box-sizing: border-box;
}

.customizer-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #212529;
}

.customizer-description {
    font-size: 14px;
    color: #6c757d;
    margin: 0 0 30px 0;
}

/* Customizer Content Layout */
.customizer-content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

/* Canvas Area (Left Side) */
.customizer-canvas-area {
    flex: 1;
    min-width: 500px;
}

.canvas-wrapper {
    position: relative;
    width: 500px;
    height: 500px;
    margin: 0 auto 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

#estiene-design-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: default;
}

.circle-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 400px;
    height: 400px;
    margin-left: -200px;
    margin-top: -200px;
    border: 2px dashed #007bff;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.5;
}

/* Image Controls */
.image-controls {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.control-group {
    margin-bottom: 20px;
}

.control-group:last-of-type {
    margin-bottom: 0;
}

.control-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
}

.control-group input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #dee2e6;
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 5px;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.control-group input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007bff;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.scale-value,
.rotate-value {
    display: inline-block;
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
}

.control-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn-fit-circle,
.btn-center-image {
    flex: 1;
    padding: 10px 15px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #007bff;
    color: #ffffff;
}

.btn-fit-circle:hover,
.btn-center-image:hover {
    background: #0056b3;
}

.btn-delete-image {
    width: 100%;
    padding: 10px 20px;
    margin-top: 10px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #dc3545;
    color: #ffffff;
}

.btn-delete-image:hover {
    background: #c82333;
}

/* Upload Area (Right Side) */
.customizer-upload-area {
    flex: 0 0 450px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Upload Section */
.upload-section {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.upload-dropzone {
    border: 2px dashed #ced4da;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.upload-dropzone:hover,
.upload-dropzone.drag-over {
    border-color: #007bff;
    background: #e7f3ff;
}

.upload-dropzone svg {
    color: #6c757d;
    margin-bottom: 15px;
}

.upload-dropzone p {
    margin: 0;
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

.upload-hint {
    font-size: 12px !important;
    color: #6c757d !important;
    margin-top: 5px !important;
}

/* Uploaded Images List */
.uploaded-images-list {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex: 1;
}

.uploaded-images-list h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #212529;
}

.images-count {
    font-size: 14px;
    color: #6c757d;
    font-weight: 400;
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.image-thumbnail {
    position: relative;
    border: 3px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
}

.image-thumbnail-preview {
    position: relative;
    aspect-ratio: 1;
    cursor: pointer;
    overflow: hidden;
}

.image-thumbnail:hover {
    border-color: #007bff;
    transform: scale(1.05);
}

.image-thumbnail.selected {
    border-color: #007bff;
    border-width: 4px;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.3);
    transform: scale(1.08);
}

.image-thumbnail.selected::after {
    content: '✓';
    position: absolute;
    top: 5px;
    left: 5px;
    width: 24px;
    height: 24px;
    background: #007bff;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    z-index: 10;
}

.image-thumbnail-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Quantity Assignment */
.image-quantity-assign {
    padding: 8px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.image-quantity-assign label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.image-quantity-assign input[type="number"] {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    color: #495057;
}

.image-quantity-assign input[type="number"]:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

.image-quantity-assign input[type="number"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.quantity-validation-error {
    color: #dc3545;
    font-size: 10px;
    margin-top: 2px;
    display: none;
}

.remove-thumbnail {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: #dc3545;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 0;
    z-index: 11;
}

.image-thumbnail:hover .remove-thumbnail {
    opacity: 1;
}

.remove-thumbnail:hover {
    background: #c82333;
}

/* Action Buttons */
.customizer-actions {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-cancel-customizer,
.btn-confirm-customizer-submit {
    flex: 1;
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-cancel-customizer {
    background: #6c757d;
    color: #ffffff;
}

.btn-cancel-customizer:hover {
    background: #5a6268;
}

.btn-confirm-customizer-submit {
    background: #28a745;
    color: #ffffff;
}

.btn-confirm-customizer-submit:hover {
    background: #218838;
}

/* Change the show customizer button style */
.estiene-show-customizer-btn {
    width: 50%;
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #007bff;
    color: #ffffff;
}
.estiene-inquiry-btn{
    width: 50%;
}

.estiene-show-customizer-btn:hover {
    background: #0056b3;
}
.woocommerce div.product form.cart{
    margin-top: 0;
}
/* Responsive Design */
@media (max-width: 1200px) {
    .customizer-content {
        flex-direction: column;
    }

    .customizer-canvas-area {
        min-width: 100%;
        max-width: 100%;
    }

    .customizer-upload-area {
        flex: 1;
        width: 100%;
        max-width: 100%;
    }

    .canvas-wrapper {
        width: 100%;
        max-width: 500px;
        height: auto;
        aspect-ratio: 1;
        margin-left: auto;
        margin-right: auto;
    }

    #estiene-design-canvas {
        width: 100%;
        height: 100%;
    }
}

@media (max-width: 768px) {
    /*.estiene-image-customizer-wrapper {*/
    /*    margin-left: -50vw;*/
    /*    margin-right: -50vw;*/
    /*}*/
    .estiene-show-customizer-btn {
        width: 100%;
    }
    .estiene-inquiry-btn {
        width: 100%;
    }
    .estiene-image-customizer {
        padding: 20px;
    }

    .customizer-title {
        font-size: 20px;
    }

    .canvas-wrapper {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }

    .circle-overlay {
        width: 80%;
        height: 80%;
        margin-left: -40%;
        margin-top: -40%;
    }

    .images-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .customizer-actions {
        flex-direction: column;
    }

    .btn-cancel-customizer,
    .btn-confirm-customizer-submit {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .estiene-image-customizer {
        padding: 15px;
        margin: 20px 10px;
    }

    .customizer-content {
        gap: 20px;
    }

    .upload-dropzone {
        padding: 30px 15px;
    }

    .images-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Loading state */
.customizer-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.customizer-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-left: -20px;
    margin-top: -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animation for showing/hiding customizer */
.estiene-image-customizer {
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
