/* Photo Upload for WooCommerce - Plugin Styles */

/* Photo upload styling */
.photo-upload-container {
    margin: 20px 0;
    clear: both;
    display: block;
}

.photo-upload-container #uploadTrigger {
    display: inline-block;
    background-color: #2271b1;
    color: #ffffff;
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.photo-upload-container #uploadTrigger:hover {
    background-color: #1a5a8a;
}

.crop-size-notice {
    font-size: 12px;
    color: #666;
    margin: 5px 0 0 0;
    font-style: italic;
}

/* Customer wishes styling */
.customer-wishes-container {
    margin-top: 15px;
}

.customer-wishes-container label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.customer-wishes-container textarea {
    width: 100%;
    height: 80px;
    margin-top: 5px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    transition: border-color 0.3s ease;
}

.customer-wishes-container textarea:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 1px #2271b1;
}

.customer-wishes-container textarea::placeholder {
    color: #999;
    font-style: italic;
}

/* Cropper Modal Styles */
#cropper-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 999999;
    display: none;
}

#cropper-modal .modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 20px;
    border-radius: 5px;
    max-width: 90%;
    max-height: 90%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#cropper-container {
    max-width: 80vw;
    max-height: 70vh;
    overflow: auto;
    margin-bottom: 15px;
}

#cropper-container img {
    max-width: 100%;
    height: auto;
}

/* Cropper control buttons */
.cropper-controls {
    text-align: center;
    margin-top: 15px;
}

.cropper-controls button {
    margin: 0 5px;
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    border: 1px solid #ddd;
    background: #f7f7f7;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.cropper-controls button:hover {
    background: #e7e7e7;
    border-color: #aaa;
}

#crop-apply {
    background-color: #2271b1 !important;
    color: #ffffff !important;
    border-color: #2271b1 !important;
}

#crop-apply:hover {
    background-color: #1a5a8a !important;
    border-color: #1a5a8a !important;
}

#crop-cancel {
    background-color: #dc3232 !important;
    color: #ffffff !important;
    border-color: #dc3232 !important;
}

#crop-cancel:hover {
    background-color: #c02d2d !important;
    border-color: #c02d2d !important;
}

/* Shape button styles (if used) */
.shape-button {
    width: 40px;
    height: 40px;
    margin: 0 5px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s ease;
}

.shape-button:hover {
    border-color: #2271b1;
    transform: scale(1.1);
}

.shape-button.active {
    border-color: #2271b1;
    background: #f0f7ff;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #cropper-modal .modal-content {
        padding: 15px;
        max-width: 95%;
        max-height: 95%;
    }
    
    #cropper-container {
        max-width: 85vw;
        max-height: 60vh;
    }
    
    .cropper-controls button {
        margin: 5px 2px;
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Loading spinner */
.photo-upload-loading {
    display: none;
    margin-left: 10px;
}

.photo-upload-loading.active {
    display: inline-block;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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