/* Your existing CSS */
.preview-file-upload-photo img {
    max-width: 100%;
}

.close-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #444;
    font-size: 18px;
    padding: 6px;
    cursor: pointer;
    z-index: 1;
    text-shadow: 0 2px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    background: none;
}

/* Enhanced styles for better Safari compatibility */
.image-container {
    position: relative;
    display: inline-block;
}

.upload-photo {
    position: relative;
}

.upload-photo input[type="file"] {
    /* Ensure file inputs are properly styled in Safari */
    -webkit-appearance: none;
    appearance: none;
}

.ajax-loader {
    padding: 10px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* Better mobile compatibility */
@media (max-width: 768px) {
    .close-overlay {
        top: 5px;
        right: 5px;
        font-size: 16px;
        padding: 8px;
        background: rgba(255, 255, 255, 0.8);
        border-radius: 50%;
    }
    
    .preview-file-upload-photo img {
        max-width: 100%;
        height: auto;
    }
}

/* Safari-specific fixes */
@media not all and (min-resolution:.001dpcm) {
    @supports (-webkit-appearance:none) {
        .upload-photo input[type="file"] {
            /* Safari-specific file input styling */
            border: 1px solid #ccc;
            border-radius: 4px;
            padding: 5px;
        }
    }
}

/* Loading animation */
.ajax-loader {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin: 10px 0;
}

.ajax-loader:after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 10px;
    border: 2px solid #ccc;
    border-top-color: #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error states */
.upload-error {
    color: #d9534f;
    background: #f2dede;
    border: 1px solid #ebccd1;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
}

/* Success states */
.upload-success {
    color: #3c763d;
    background: #dff0d8;
    border: 1px solid #d6e9c6;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
}
